wave recipes + tanks
This commit is contained in:
+14
-1
@@ -18,6 +18,7 @@ Enemy :: struct {
|
||||
Enemy_Kind :: enum {
|
||||
Grunt,
|
||||
Runner,
|
||||
Tank,
|
||||
}
|
||||
|
||||
Enemy_Archetype :: struct {
|
||||
@@ -43,10 +44,18 @@ get_enemy_archetype :: proc(kind: Enemy_Kind, wave: int) -> Enemy_Archetype {
|
||||
speed = 95 + f32(wave) * 3,
|
||||
color = rl.ORANGE,
|
||||
}
|
||||
case .Tank:
|
||||
return {
|
||||
kind = .Tank,
|
||||
health = 50 + wave * 12,
|
||||
speed = 35 + f32(wave) * 2,
|
||||
color = rl.DARKGREEN,
|
||||
}
|
||||
}
|
||||
|
||||
return {}
|
||||
}
|
||||
|
||||
acquire_enemy :: proc(world: ^World) -> ^Enemy {
|
||||
// create an object pool with fixed slots to reuse instead of allocate/free every spawn
|
||||
for i in 0 ..< MAX_ENEMIES {
|
||||
@@ -120,13 +129,17 @@ render_enemies :: proc(world: ^World) {
|
||||
e := world.enemies[i]
|
||||
if !e.active do continue
|
||||
color := rl.MAROON
|
||||
size := 11
|
||||
switch e.kind {
|
||||
case .Grunt:
|
||||
color = rl.MAROON
|
||||
case .Runner:
|
||||
color = rl.ORANGE
|
||||
case .Tank:
|
||||
color = rl.DARKGREEN
|
||||
size = 14
|
||||
}
|
||||
rl.DrawCircle(i32(e.position.x), i32(e.position.y), 11, color)
|
||||
rl.DrawCircle(i32(e.position.x), i32(e.position.y), f32(size), color)
|
||||
if e.slow_timer > 0 {
|
||||
rl.DrawCircleLines(i32(e.position.x), i32(e.position.y), 14, rl.SKYBLUE)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user