move waves and enemy count to overlay

This commit is contained in:
2026-06-20 22:26:21 -07:00
parent 0729384898
commit a968ad98fd
2 changed files with 16 additions and 11 deletions
-11
View File
@@ -1,11 +0,0 @@
package game
import "core:fmt"
import rl "vendor:raylib"
render_hud :: proc(world: ^World) {
rl.DrawText(fmt.ctprintf("Enemies: %d", active_enemy_count(world)), 10, 54, 22, rl.BLACK)
rl.DrawText(fmt.ctprintf("Wave: %d / %d", world.wave, MAX_WAVES), 10, 76, 22, rl.BLACK)
}
+16
View File
@@ -18,9 +18,25 @@ render_overlay :: proc(world: ^World) {
hp := fmt.ctprintf("Health: %d", world.base_health)
rl.DrawText(hp, x, y, font_size, OVERLAY_TEXT_COLOR)
x += rl.MeasureText(hp, font_size) + gap
enemies := fmt.ctprintf("Enemies: %d", active_enemy_count(world))
rl.DrawText(enemies, x, y, font_size, enemy_label_color(world))
x += rl.MeasureText(enemies, font_size) + gap
waves := fmt.ctprintf("Waves: %d / %d", world.wave, MAX_WAVES)
rl.DrawText(waves, x, y, font_size, OVERLAY_TEXT_COLOR)
if world.phase == .Game_Over || world.phase == .Victory {
draw_end_screen(world)
}
}
enemy_label_color :: proc(world: ^World) -> rl.Color {
if world.phase == .Combat {
return rl.Color{255, 200, 200, 255}
}
return OVERLAY_TEXT_COLOR
}