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

View File

@@ -6,6 +6,7 @@ extends NodeState
const GRAVITY = player.GRAVITY
@onready var speed = player.speed
@onready var maxSpeed = player.maxSpeed
@onready var friction = player.friction
@warning_ignore("unused_parameter")
func on_process(delta: float) -> void:
@@ -16,8 +17,8 @@ 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, maxSpeed, 100 * 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