crouch still needs tweaking on the camera but functional, added air dash

This commit is contained in:
derek
2025-06-16 13:51:45 -05:00
parent d5d83c75f7
commit 50d8935b4b
8 changed files with 104 additions and 0 deletions

25
scripts/player_jumping.gd Normal file
View File

@@ -0,0 +1,25 @@
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 Input.is_action_just_pressed("jump") and character.jumps_remaining > 0:
character.jumps_remaining -= 1
character.velocity.y += character.JUMP_VELOCITY
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 character.is_on_floor():
Transitioned.emit(self,"on foot")