forked from team-sg/hero-mark-2
hitting a corner in falling state pushes sg back (fixes #62)
This commit is contained in:
parent
51eeef3941
commit
3ac3c7343c
1 changed files with 8 additions and 0 deletions
|
@ -67,6 +67,9 @@ func _physics_process(delta):
|
||||||
State.FALL:
|
State.FALL:
|
||||||
_process_fall()
|
_process_fall()
|
||||||
continue
|
continue
|
||||||
|
State.IDLE, State.FALL:
|
||||||
|
_process_idle_fall()
|
||||||
|
continue
|
||||||
State.JUMP, State.FALL:
|
State.JUMP, State.FALL:
|
||||||
_process_jump_fall()
|
_process_jump_fall()
|
||||||
continue
|
continue
|
||||||
|
@ -148,6 +151,11 @@ func _process_fall():
|
||||||
#Cant move in air
|
#Cant move in air
|
||||||
if !can_move_in_air: velocity.x = 0
|
if !can_move_in_air: velocity.x = 0
|
||||||
|
|
||||||
|
#Corner collision
|
||||||
|
func _process_idle_fall():
|
||||||
|
if is_on_wall():
|
||||||
|
position.x += get_last_slide_collision().normal.x
|
||||||
|
|
||||||
func _process_jump_fall():
|
func _process_jump_fall():
|
||||||
check_double_jump()
|
check_double_jump()
|
||||||
move(walk_speed,0,true)
|
move(walk_speed,0,true)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue