Added wall jumps and tweaked values and movement
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user