![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | plov |
var vel = Vector2()
var speed = 200
var jump = 1000
const gravity = 500
const FLOOR = Vector2(0, -1)
func _physics_process(delta):
if Input. is_action_pressed(“player_left”):
vel.x = -speed
elif Input. is_action_pressed(“player_right”):
vel.x = speed
else:
vel.x = 0
if Input. is_action_pressed("player_jump"):
vel.y = -jump
vel.y = gravity
move_and_slide(vel)