func _process(delta):
# 移動方向・速度をゼロでクリア
var velocity = Vector2.ZERO
# Input.is_action_pressed 関数でキーを押しているかチェック出来る
if Input.is_action_pressed("right"):
velocity.x = speed
if Input.is_action_pressed("left"):
velocity.x = -speed
if Input.is_action_pressed("down"):
velocity.y = speed
if Input.is_action_pressed("up"):
velocity.y = -speed
position += velocity*delta
position = position.clamp(Vector2.ZERO, screen_size)