add death sound and refactor jump sound

This commit is contained in:
2025-10-21 20:33:38 +01:00
parent a1b28ee5d3
commit 1fcc9a0a35
5 changed files with 13 additions and 47 deletions

View File

@@ -1,9 +1,11 @@
extends Area2D
@onready var timer: Timer = $Timer
@onready var death: AudioStreamPlayer2D = $Death
func _on_body_entered(player_body: Node2D) -> void:
print("You died.")
death.play()
Engine.time_scale = 0.5
player_body.get_node(NodeTypes.COLLISION_SHAPE_2D).queue_free()
var player_character_body = player_body as CharacterBody2D