24 lines
419 B
Odin
24 lines
419 B
Odin
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 <= 5 {
|
|
w.grid[x][y] = tree_tile
|
|
}
|
|
}
|
|
}
|
|
}
|