Health and killing zones
This commit is contained in:
@ -35,9 +35,10 @@ func _on_player_detection_body_exited(body: Node2D) -> void:
|
||||
|
||||
func _on_killingzone_body_entered(body: Node2D) -> void:
|
||||
if body.name == "Player":
|
||||
if player.global_position.y < self.global_position.y - 10 :
|
||||
if player.global_position.y < self.global_position.y - 20 :
|
||||
get_node("AnimatedSprite2D").play("death")
|
||||
alive = false
|
||||
self.collision_mask = 2
|
||||
timer.start()
|
||||
elif alive:
|
||||
print("HURT")
|
||||
|
Reference in New Issue
Block a user