Skip to content

Commit

Permalink
adjust variable jump height for mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
zvoverman committed Aug 31, 2024
1 parent 968af25 commit 11a7a47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ func _physics_process(delta):
move_and_slide()

func jump():
velocity.y = JUMP_VELOCITY
state_machine.travel("kickflip")
velocity.y = JUMP_VELOCITY

func damage():
World.reset()
Expand All @@ -37,7 +37,7 @@ func _unhandled_input(event):
if event is InputEventScreenTouch and is_on_floor():
jump()

if event is InputEventScreenTouch and event.pressed:
if event is InputEventScreenTouch and event.pressed and !is_on_floor() and velocity.y < 0:
is_pressed = true
else:
is_pressed = false

0 comments on commit 11a7a47

Please sign in to comment.