separate out render methods

This commit is contained in:
2026-06-13 23:46:51 -07:00
parent b9235246c7
commit 042fc9fe62
4 changed files with 45 additions and 35 deletions
+18
View File
@@ -1,5 +1,8 @@
package game
import "core:fmt"
import rl "vendor:raylib"
Enemy :: struct {
position: Vec2,
health: int,
@@ -75,3 +78,18 @@ active_enemy_count :: proc(world: ^World) -> int {
return count
}
render_enemies :: proc(world: ^World) {
for i in 0 ..< MAX_ENEMIES {
e := world.enemies[i]
if !e.active do continue
rl.DrawCircle(i32(e.position.x), i32(e.position.y), 11, rl.MAROON)
rl.DrawText(
fmt.ctprintf("%d", e.health),
i32(e.position.x) - 4,
i32(e.position.y) - 18,
12,
rl.WHITE,
)
}
}