Files
2026-06-28 00:08:43 -07:00

34 lines
1012 B
Odin

package game
import "core:fmt"
import rl "vendor:raylib"
render_overlay :: proc(world: ^World) {
rl.DrawRectangle(0, 0, SCREEN_W, OVERLAY_BAR_H, OVERLAY_BAR_COLOR)
y: i32 = (OVERLAY_BAR_H - OVERLAY_FONT_SIZE) / 2
x: i32 = OVERLAY_PADDING
gap: i32 : 16
gold := fmt.ctprintf("Gold: %d", world.gold)
rl.DrawText(gold, OVERLAY_PADDING, OVERLAY_PADDING, 18, OVERLAY_GOLD_COLOR)
x += rl.MeasureText(gold, OVERLAY_FONT_SIZE) + gap
hp := fmt.ctprintf("Health: %d", world.base_health)
rl.DrawText(hp, x, y, OVERLAY_FONT_SIZE, OVERLAY_TEXT_COLOR)
x += rl.MeasureText(hp, OVERLAY_FONT_SIZE) + gap
enemies := fmt.ctprintf("Enemies: %d", active_enemy_count(world))
rl.DrawText(enemies, x, y, OVERLAY_FONT_SIZE, ENEMY_LABEL_COLOR)
x += rl.MeasureText(enemies, OVERLAY_FONT_SIZE) + gap
waves := fmt.ctprintf("Waves: %d / %d", world.wave, MAX_WAVES)
rl.DrawText(waves, x, y, OVERLAY_FONT_SIZE, OVERLAY_TEXT_COLOR)
if world.phase == .Game_Over || world.phase == .Victory {
draw_end_screen(world)
}
}