init commit
This commit is contained in:
17
entities/player/player.gd
Normal file
17
entities/player/player.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
extends CharacterBody2D
|
||||
|
||||
|
||||
const SPEED = 300.0
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
|
||||
# Get the input direction and handle the movement/deceleration.
|
||||
# As good practice, you should replace UI actions with custom gameplay actions.
|
||||
var direction := Input.get_vector("ui_left", "ui_right","ui_up", "ui_down")
|
||||
if direction:
|
||||
velocity = direction * SPEED
|
||||
else:
|
||||
velocity = lerp(velocity, Vector2.ZERO, 0.75)
|
||||
|
||||
move_and_slide()
|
||||
Reference in New Issue
Block a user