knockback; base enemy scene; police van
This commit is contained in:
parent
370eb54163
commit
d0bfe8d1be
13 changed files with 218 additions and 111 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue