simplify air state code

This commit is contained in:
Nathan Lovato 2019-08-13 14:45:03 +02:00
parent 718a6e00d5
commit 1d0c826ef8

View file

@ -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