Collision detection, better camera stuff, random trees, etc
This commit is contained in:
23
game/tiles.odin
Normal file
23
game/tiles.odin
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user