Attach momentum to elevator

This commit is contained in:
2020-06-01 05:32:07 -04:00
parent 1980139acb
commit 3dd00eabd3
5 changed files with 43 additions and 2 deletions

View File

@ -14,6 +14,7 @@ var jumped = false
var moveMotion : float = 0 # Player Input ( <- & -> )
var motion : Vector2 = Vector2(0,0) # Player's current velocity
var floor_speed : Vector2 = Vector2.ZERO
var gui # Node representing GUI object
@ -104,6 +105,7 @@ func _physics_process(delta):
# Apply velocity to frame
motion.x = moveMotion
motion = motion + floor_speed
animation_manager(moveMotion)
move_and_slide(motion, Vector2(0,-1))