36 lines
725 B
GDScript
36 lines
725 B
GDScript
extends PlayerState
|
|
class_name PlayerJumping
|
|
|
|
@export var air_dash_amount = 40.0
|
|
|
|
var air_dash_max = 1
|
|
var air_dash_left
|
|
|
|
func Enter():
|
|
air_dash_left = air_dash_max
|
|
|
|
func Physics_Update(delta):
|
|
standard_movement(delta)
|
|
apply_gravity(delta)
|
|
|
|
if character.is_on_floor():
|
|
Transitioned.emit(self,"on foot")
|
|
|
|
if Input.is_action_just_pressed("sprint") and air_dash_left > 0:
|
|
air_dash_left -= 1
|
|
character.velocity += character.movement_input().normalized() * air_dash_amount
|
|
|
|
if Input.is_action_just_pressed("crouch"):
|
|
Transitioned.emit(self,"ground pound")
|
|
|
|
enable_wall_rays()
|
|
|
|
if can_wall_run():
|
|
start_wall_running()
|
|
|
|
ledge_grab()
|
|
standard_jump()
|
|
|
|
func Exit():
|
|
character.ledge_collision.disabled = true
|