extends KinematicBody2D
var score : int = 0
var speed : int = 200
var jumpForce : int = 600
var gravity : int = 800
var velocity : Vector2 = Vector2()
onready var sprite : Sprite = get_node("Sprite")
func physicsprocess(delta):
velocity.x = 0
if Input.is_action_pressed("move_left"):
velocity.x -= speed
if Input.is_action_pressed("move_right"):
velocity.x += speed
moveandslide(velocity, Vector2.UP) #When i add velocity it changes to Unexpected token: Identifier: velocity, if there is no velocity it becomes Unexpected token: Identifier: moveandslide