This commit is contained in:
Debugman committed 2026-10-17 16:55:31 -05:00
1 parent 6a4c7b5c07
commit 4a1dc0cc69
22 files changed
+182 -3

No files matched your search

+18 -2
View File
@@ -45,8 +45,21 @@ func on_teleport():
await get_tree().create_timer(1).timeout
teleport_cooldown = 0
func on_death():
func on_death(instant = false):
#$BackgroundMusic
if !instant:
get_tree().paused = true
$Jetpack/DeathSound.play()
$Sprite2D.hide()
await get_tree().create_timer(0.2).timeout
$Sprite2D.show()
await get_tree().create_timer(0.2).timeout
$Sprite2D.hide()
await get_tree().create_timer(0.2).timeout
$Sprite2D.show()
await get_tree().create_timer(0.2).timeout
get_tree().paused = false
position = %LevelStart.position
func _process(delta: float) -> void:
@@ -57,8 +70,10 @@ func _process(delta: float) -> void:
if is_on_floor():
velocity.y = JUMP_VELOCITY
elif !is_on_floor() and jumps >= 1:
#Air/double jump
jumps -= 1
velocity.y = JUMP_VELOCITY
$Jetpack/DoubleJumpSound.play()
if jumps == 0:
$Jetpack/JumpIndicator.hide()
@@ -99,9 +114,10 @@ func _process(delta: float) -> void:
$Sprite2D/HatSprite.play("idle")
#print("PLAYER X POSITION: " + str(position.y))
#Falling to death.
if position.y >= death_threshold:
print("SLASH KILL")
on_death()
on_death(true)
fall_timer += 1*delta
if is_on_floor():