refactor gold rewards and tower cost; fix wave test leak
This commit is contained in:
@@ -102,13 +102,8 @@ update_homing_projectile :: proc(world: ^World, p: ^Projectile, dt: f32) {
|
||||
move_toward(&p.position, target.position, p.speed, dt)
|
||||
|
||||
if distance(p.position, target.position) <= PROJECTILE_HIT_RADIUS {
|
||||
target.health -= p.damage
|
||||
p.active = false
|
||||
|
||||
if target.health <= 0 {
|
||||
target.active = false
|
||||
push_event(world, .Enemy_Killed, gold_reward = 5)
|
||||
}
|
||||
apply_tower_hit(world, target, p.damage)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user