forked from team-sg/hero-mark-2
disable ladder dismount while pressing towards ladder (closes #128)
This commit is contained in:
parent
63840a3199
commit
75a1091ce8
1 changed files with 4 additions and 2 deletions
|
@ -358,8 +358,10 @@ func _process_climbing(delta: float) -> void:
|
||||||
global_position.x -= graphics.scale.x * 3.0
|
global_position.x -= graphics.scale.x * 3.0
|
||||||
state_chart.send_event("ladder_jump")
|
state_chart.send_event("ladder_jump")
|
||||||
elif Input.is_action_just_pressed("shoot"):
|
elif Input.is_action_just_pressed("shoot"):
|
||||||
global_position.x -= graphics.scale.x * 3.0
|
var horizontal_dir = sign(Input.get_axis("ui_left", "ui_right"))
|
||||||
state_chart.send_event("ladder_detach")
|
if sign(_attached_ladder.middle - global_position.x) != horizontal_dir:
|
||||||
|
global_position.x -= graphics.scale.x * 3.0
|
||||||
|
state_chart.send_event("ladder_detach")
|
||||||
# # auto-dismount on ground
|
# # auto-dismount on ground
|
||||||
# elif Input.is_action_pressed("ui_down") and is_on_floor():
|
# elif Input.is_action_pressed("ui_down") and is_on_floor():
|
||||||
# var horizontal_dir = sign(Input.get_axis("ui_left", "ui_right"))
|
# var horizontal_dir = sign(Input.get_axis("ui_left", "ui_right"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue