This commit is contained in:
parent
66efed9c32
commit
29a7f80186
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,3 +2,4 @@
|
||||||
# Godot-specific ignores
|
# Godot-specific ignores
|
||||||
.import/
|
.import/
|
||||||
export.cfg
|
export.cfg
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,31 @@
|
||||||
extends Node
|
extends KinematicBody2D
|
||||||
|
|
||||||
# Declare member variables here. Examples:
|
const UP = Vector2(0, -1)
|
||||||
# var a = 2
|
const GRAVITY = 32
|
||||||
# var b = "text"
|
const SPEED = 200
|
||||||
|
const JUMP_HEIGHT = -550
|
||||||
|
var motion = Vector2()
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
func _physics_process(delta):
|
||||||
func _ready():
|
motion.y += GRAVITY
|
||||||
pass # Replace with function body.
|
|
||||||
|
if Input.is_action_pressed("ui_right"):
|
||||||
|
motion.x = SPEED
|
||||||
|
elif Input.is_action_pressed("ui_left"):
|
||||||
|
motion.x = -SPEED
|
||||||
|
else:
|
||||||
|
motion.x = 0
|
||||||
|
|
||||||
|
if is_on_floor():
|
||||||
|
if Input.is_action_just_pressed("ui_up"):
|
||||||
|
motion.y = JUMP_HEIGHT
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
motion = move_and_slide(motion, UP)
|
||||||
#func _process(delta):
|
|
||||||
# pass
|
if position.y >= 493:
|
||||||
|
get_tree().change_scene("Death Screen.tscn")
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
func _on_Area2D_body_entered(body):
|
||||||
|
body.get_tree().change_scene("Logan is awful.tscn")
|
||||||
|
|
Loading…
Reference in a new issue