oh-my-git/player.gd

12 lines
314 B
GDScript3
Raw Normal View History

2020-01-29 20:25:13 +01:00
extends KinematicBody2D
export var speed = 800
func _ready():
pass
2020-01-29 20:25:13 +01:00
func _process(delta):
var right = Input.get_action_strength("right") - Input.get_action_strength("left")
var down = Input.get_action_strength("down") - Input.get_action_strength("up")
move_and_slide(Vector2(right, down).normalized()*speed)