Skip to content

Commit 9bc83e8

Browse files
committed
reformat player.gd
1 parent a757f3a commit 9bc83e8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

scenes/Player.gd

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
extends CharacterBody2D
22

3-
43
@export var speed: int = 400
54
@export var GRAVITY: int = 1200
65
@export var jump_speed: int = -400
76

7+
88
func get_input():
99
velocity.x = 0
1010
if is_on_floor() and Input.is_action_just_pressed("jump"):
@@ -14,19 +14,21 @@ func get_input():
1414
if Input.is_action_pressed("left"):
1515
velocity.x -= speed
1616

17+
1718
func _physics_process(delta):
1819
velocity.y += delta * GRAVITY
1920
get_input()
2021
move_and_slide()
2122

23+
2224
func _process(_delta):
2325
if not is_on_floor():
2426
$Animator.play("Jump")
2527
elif velocity.x != 0:
2628
$Animator.play("Walk")
2729
else:
2830
$Animator.play("Idle")
29-
31+
3032
if velocity.x != 0:
3133
if velocity.x > 0:
3234
$Sprite2D.flip_h = false

0 commit comments

Comments
 (0)