Collision detection, better camera stuff, random trees, etc

This commit is contained in:
2025-02-25 23:26:32 -06:00
parent 88a795264c
commit 3914d6c1a7
6 changed files with 99 additions and 25 deletions

23
game/tiles.odin Normal file
View File

@@ -0,0 +1,23 @@
package game
import rl "vendor:raylib"
import "core:math/rand"
tree_tile := Tile {
type = .WALL,
tilemap_pos = {0,1},
color = rl.DARKGREEN
}
place_random_trees :: proc(w:^World) {
for x in 0..< len(w.grid) {
for y in 0..< len(w.grid) {
chance := rand.int_max(100)
if chance <= 10 {
w.grid[x][y] = tree_tile
}
}
}
}