Files
tower-defense-prototype/game/world.odin
T
2026-06-10 02:32:01 -07:00

28 lines
526 B
Odin

package game
import "core:fmt"
import rl "vendor:raylib"
World :: struct {
gold: int,
base_health: int,
}
init_world :: proc() -> World {
return World{gold = 10, base_health = 20}
}
// update world, never draw
update_world :: proc(world: ^World, dt: f32) {
_ = dt
if rl.IsKeyPressed(.G) {
world.gold += 10
}
}
render_world :: proc(world: ^World) {
rl.DrawText(fmt.caprintf("gold: %d", world.gold), 10, 10, 22, rl.BLACK)
rl.DrawText(fmt.caprintf("health: %d", world.base_health), 10, 38, 22, rl.BLACK)
}