moveable
This commit is contained in:
parent
abb54d45ca
commit
6a9a99389c
8 changed files with 39 additions and 4 deletions
|
@ -54,6 +54,12 @@ func _physics_process(delta):
|
|||
get_input(delta)
|
||||
velocity.y += gravity
|
||||
move_and_slide()
|
||||
|
||||
if(get_slide_collision_count() > 0):
|
||||
for i in get_slide_collision_count():
|
||||
var box = get_slide_collision(i).get_collider() as Box
|
||||
if box and velocity.y >= 0:
|
||||
box.velocity.x = velocity.x*0.8
|
||||
# print(jump_count) # Uncomment for debugging
|
||||
|
||||
func Jump():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue