knockback; base enemy scene; police van

This commit is contained in:
Michael Campbell 2026-03-18 16:14:34 -04:00
parent 370eb54163
commit d0bfe8d1be
13 changed files with 218 additions and 111 deletions

View file

@ -6,8 +6,11 @@ func _ready() -> void:
assert(get_parent() is PoliceCar)
parent = get_parent()
func hit(projectile: PlayerProjectile, _damage: float) -> bool:
if projectile == null: return false
func hit(proj: Node3D, _damage: float) -> bool:
if proj == null: return false
if proj is not PlayerProjectile: return false
var projectile := proj as PlayerProjectile
if not projectile.can_hit_weak_points: return false
var angle := projectile.velocity.angle_to(-parent.velocity)