diff options
Diffstat (limited to 'Characters')
-rw-r--r-- | Characters/Character.gd | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Characters/Character.gd b/Characters/Character.gd index e5623b1..a60046b 100644 --- a/Characters/Character.gd +++ b/Characters/Character.gd @@ -10,6 +10,7 @@ var direction = Enum.DIRECTION.RIGHT var canDoubleJump = false var hasPlayedFallStop = false +var jumpHeightModifier = 0 func _physics_process(_delta): @@ -65,9 +66,16 @@ func _physics_process(_delta): if is_on_floor(): canDoubleJump = true velocity.y = JUMPFORCE + jumpHeightModifier = JUMPFORCE elif not is_on_floor() and not is_on_wall() and canDoubleJump: canDoubleJump = false velocity.y = JUMPFORCE + if Input.is_action_pressed("ui_up"): + jumpHeightModifier += 10 + if jumpHeightModifier > 0: + jumpHeightModifier = 0 + if Input.is_action_just_released("ui_up"): + velocity.y -= jumpHeightModifier if is_on_wall(): |