add end screens
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package game
|
||||
|
||||
import "core:fmt"
|
||||
import rl "vendor:raylib"
|
||||
|
||||
draw_end_screen :: proc(world: ^World) {
|
||||
title: cstring = "GAME OVER"
|
||||
title_color := rl.RED
|
||||
sub: cstring = "Press close to quit"
|
||||
sub_color := OVERLAY_TEXT_COLOR
|
||||
|
||||
if world.phase == .Victory {
|
||||
title = "VICTORY!"
|
||||
title_color = rl.GREEN
|
||||
sub = fmt.ctprintf("You survived %d waves!", MAX_WAVES)
|
||||
}
|
||||
|
||||
|
||||
rl.DrawRectangle(0, 0, SCREEN_W, SCREEN_H, rl.Color{0, 0, 0, 140})
|
||||
|
||||
title_font: i32 = 40
|
||||
tw := rl.MeasureText(title, title_font)
|
||||
rl.DrawText(title, (SCREEN_W - tw) / 2, SCREEN_H / 2 - 50, title_font, title_color)
|
||||
|
||||
sub_font: i32 = 18
|
||||
sw := rl.MeasureText(sub, sub_font)
|
||||
rl.DrawText(sub, (SCREEN_W - sw) / 2, SCREEN_H / 2 + 10, sub_font, sub_color)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user