Added wall jumps and tweaked values and movement

This commit is contained in:
2026-02-16 23:47:10 -05:00
parent 5518f3ce79
commit c3d09c9a88
6 changed files with 64 additions and 20 deletions
@@ -9,12 +9,12 @@ extends NodeState
@export_category("Fall State")
@export var coyoteTime: float = .2
@export var coyoteTime: float = .4
var coyoteJump: bool
const GRAVITY = player.GRAVITY
@onready var speed = player.speed
@onready var maxSpeed = player.maxSpeed
@onready var maxSpeed = player.maxAirSpeed
@onready var friction = player.airFriction
@@ -33,7 +33,7 @@ func on_phyisics_process(delta: float) -> void:
if direction:
player.velocity.x += direction * speed * delta
player.velocity.x = clamp(player.velocity.x, -maxSpeed, maxSpeed)
player.velocity.x = move_toward(player.velocity.x, clamp(player.velocity.x, -maxSpeed, maxSpeed), friction * delta)
if direction != 0:
animatedSprite2D.flip_h = false if direction > 0 else true