Skip to content

Instantly share code, notes, and snippets.

@seisvelas
Created January 18, 2021 02:40
Show Gist options
  • Save seisvelas/cbc15329cfe991adf7b4c22123155a5c to your computer and use it in GitHub Desktop.
Save seisvelas/cbc15329cfe991adf7b4c22123155a5c to your computer and use it in GitHub Desktop.
Move and slice Godot script for Pancho
extends KinematicBody2D
var motion = Vector2()
func _physics_process(_delta):
motion.y += 10
if Input.is_action_pressed("ui_right"):
motion.x = 200
elif Input.is_action_pressed("ui_left"):
motion.x = -200
else:
motion.x = 0
var _mov_and_slide_ret = move_and_slide(motion)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment