Merge remote-tracking branch 'origin/main' into quests
This commit is contained in:
commit
fa9ec1e5cd
39 files changed
+557
-33
No files matched your search
+28
-3
@@ -28,12 +28,17 @@ func refresh_dash(new_dashes):
|
||||
dashes = new_dashes
|
||||
else:
|
||||
dashes = 1
|
||||
if dashes > 0:
|
||||
$Jetpack/DashIndicator.show()
|
||||
|
||||
|
||||
func refresh_jump(new_jumps):
|
||||
if new_jumps:
|
||||
jumps = new_jumps
|
||||
else:
|
||||
jumps = 1
|
||||
if jumps > 0:
|
||||
$Jetpack/JumpIndicator.show()
|
||||
|
||||
func give_disk(disk_num: int) -> void:
|
||||
data_disks.push_back(disk_num)
|
||||
@@ -43,7 +48,7 @@ func take_disk() -> int:
|
||||
if disk_num:
|
||||
return disk_num
|
||||
return 0
|
||||
|
||||
|
||||
func on_teleport():
|
||||
refresh_jump(1)
|
||||
teleport_cooldown = 1
|
||||
@@ -51,8 +56,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:
|
||||
@@ -63,8 +81,12 @@ 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()
|
||||
|
||||
if Input.is_action_pressed("jump") and is_on_wall_only():
|
||||
print("WALL HANGING")
|
||||
@@ -89,6 +111,8 @@ func _process(delta: float) -> void:
|
||||
) * DASH_SPEED
|
||||
await get_tree().create_timer(DASH_LENGTH).timeout
|
||||
dashing = false
|
||||
if dashes == 0:
|
||||
$Jetpack/DashIndicator.hide()
|
||||
|
||||
elif direction and !dashing:
|
||||
velocity.x = direction * SPEED
|
||||
@@ -101,9 +125,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():
|
||||
|
||||
Reference in new issue
Block a user