added falling
This commit is contained in:
parent
5510d89edc
commit
bd91fb7117
10 changed files with 147 additions and 5 deletions
|
@ -1,6 +1,7 @@
|
|||
extends CharacterBody2D
|
||||
|
||||
@export var speed = 50
|
||||
@export var gravity = 50
|
||||
|
||||
func get_input():
|
||||
var input_direction = Input.get_axis("player_left", "player_right")
|
||||
|
@ -8,4 +9,5 @@ func get_input():
|
|||
|
||||
func _physics_process(delta):
|
||||
get_input()
|
||||
velocity.y += gravity
|
||||
move_and_slide()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue