adjusted jump height

This commit is contained in:
pennyrigate 2022-12-17 00:04:41 -05:00
parent 8f6a068eba
commit 28319efe0d
3 changed files with 22 additions and 16 deletions

View file

@ -13,9 +13,9 @@ var axis = Vector2.ZERO
##Physics
var velocity = Vector2.ZERO
var walk_speed = 50
var gravity = 12.50
var gravity = 12
var jump_pressure = 0
var jump_force = 200
var jump_force = 150
var current_ladder = null
##Attacking
@ -49,7 +49,7 @@ func _physics_process(delta):
if current_state != State.CLIMB: velocity.y += gravity
#Apply velocity
move_and_slide(velocity,Vector2.UP)
print(velocity.y)
#Debug
if Input.is_action_pressed("debug_move_player"):
position = get_viewport().get_mouse_position()
@ -89,6 +89,7 @@ func _process_idle_walk():
func _process_jump():
jump_pressure += 1
move(walk_speed,0,true)
#Pressure sensitive jump
if jump_pressure == 15 or Input.is_action_just_released("jump"):
velocity.y = -jump_force / 4
@ -145,6 +146,7 @@ func check_jump():
position.x -= sprite.scale.x * 5
anims.set_speed_scale(1)
# Jump
velocity.y = 0
jump_pressure = 0
current_state = State.JUMP
Game.play_sound(Game.a_jump,Game.ac_jump)