Загрузка данных


extends KinematicBody2D

var speed = 250
var gravity = 900

var velocity = Vector2()

func _physics_process(delta):

    velocity.x = 0

    if Input.is_action_pressed("ui_right"):
        velocity.x = speed

    if Input.is_action_pressed("ui_left"):
        velocity.x = -speed

    velocity.y += gravity * delta

    velocity = move_and_slide(velocity, Vector2.UP)