Added traps

This commit is contained in:
2026-01-08 15:13:28 +03:00
parent 4528b4a61a
commit 9431bb4f44
7 changed files with 96 additions and 4 deletions
+8 -1
View File
@@ -62,7 +62,7 @@ func _physics_process(delta: float) -> void:
if was_collided and _is_alive:
for i in range(get_slide_collision_count()):
var collision := get_slide_collision(i)
if collision.get_collider() is AbstractEnemy:
if _is_killing_collider(collision.get_collider()):
_is_alive = false
collision_mask = 1
get_tree().paused = true
@@ -91,6 +91,13 @@ func _slow_down(delta: float) -> void:
velocity.x = move_toward(velocity.x, 0, acceleration * delta)
func _is_killing_collider(collider: Object) -> bool:
if not collider is Node: return false
var node := collider as Node
return node.has_node("PlayerKiller")
func _update_animation() -> void:
var animation := _get_animation()
if sprite.animation != animation: