move waves and enemy count to overlay
This commit is contained in:
@@ -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)
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user