mirror of
https://github.com/GDQuest/godot-platformer-2d.git
synced 2026-07-17 16:34:54 +00:00
simplify air state code
This commit is contained in:
parent
718a6e00d5
commit
1d0c826ef8
1 changed files with 1 additions and 9 deletions
|
|
@ -33,15 +33,7 @@ func unhandled_input(event: InputEvent) -> void:
|
|||
|
||||
func physics_process(delta: float) -> void:
|
||||
var move: = get_parent()
|
||||
var direction: Vector2 = move.get_move_direction() if controls_freeze.is_stopped() else Vector2(sign(move.velocity.x), 1.0)
|
||||
move.velocity = move.calculate_velocity(
|
||||
move.velocity,
|
||||
move.max_speed,
|
||||
move.acceleration,
|
||||
delta,
|
||||
direction
|
||||
)
|
||||
move.velocity = owner.move_and_slide(move.velocity, owner.FLOOR_NORMAL)
|
||||
move.physics_process(delta)
|
||||
Events.emit_signal("player_moved", owner)
|
||||
|
||||
# Landing
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue