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