separate out render methods
This commit is contained in:
@@ -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,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user