forked from team-sg/hero-mark-2
changed the way the fall sprite works
This commit is contained in:
parent
67e9a93b2b
commit
929b63c454
10 changed files with 179 additions and 42 deletions
|
@ -52,7 +52,7 @@ onready var ladder_detector: RayCast2D = $"%LadderDetector"
|
|||
onready var death_splatter_position: Position2D = $"%DeathSplatterPosition"
|
||||
onready var pushable_detector: RayCast2D = $"%PushableDetector"
|
||||
onready var oxygen_timer = $OxygenTimer
|
||||
onready var oxygen_origin = oxygen_timer.wait_time
|
||||
onready var low_oxygen_label = $LowOxygenLabel
|
||||
|
||||
# OVERRIDES #
|
||||
func _ready() -> void:
|
||||
|
@ -100,6 +100,15 @@ func _physics_process(delta: float) -> void:
|
|||
if ladder_detector.is_colliding():
|
||||
state_chart.send_event("ladder_touched")
|
||||
|
||||
# show oxygen count on low oxygen
|
||||
if underwater:
|
||||
if oxygen_timer.time_left < 5:
|
||||
low_oxygen_label.text = str(floor(oxygen_timer.time_left) + 1)
|
||||
else:
|
||||
low_oxygen_label.text = ""
|
||||
else:
|
||||
low_oxygen_label.text = ""
|
||||
|
||||
#Cheats
|
||||
#CFox mode
|
||||
if Debug.cfox_mode == true:
|
||||
|
@ -175,7 +184,7 @@ func _on_NormalJump_state_exited() -> void:
|
|||
func _on_LadderJump_state_entered() -> void:
|
||||
velocity.y = -jump_force
|
||||
Audio.play_sound(Audio.a_jump, Audio.ac_jump)
|
||||
animation_player.play("jump")
|
||||
animation_player.play("ladder_jump")
|
||||
|
||||
func _on_DoubleJump_state_entered() -> void:
|
||||
velocity.y = -double_jump_force
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue