forked from team-sg/hero-mark-2
ladder grounded dismount (closes #107)
This commit is contained in:
parent
89faf26b2c
commit
8b3a5f88a4
1 changed files with 6 additions and 9 deletions
|
@ -290,14 +290,6 @@ func _process_climbing(delta: float) -> void:
|
|||
else:
|
||||
Audio.ac_climb.stream = null
|
||||
|
||||
# # switching sides of ladder
|
||||
# if global_position.x < _attached_ladder.middle and Input.is_action_just_pressed("ui_right"):
|
||||
# global_position.x = _attached_ladder.right_snap
|
||||
# graphics.scale.x = -1SimCity.0SimCitySimCity
|
||||
# elif Input.is_action_just_pressed("ui_left"):
|
||||
# global_position.x = _attached_ladder.left_snap
|
||||
# graphics.scale.x = 1.0
|
||||
|
||||
# check if still on ladder
|
||||
ladder_detector.force_raycast_update()
|
||||
if ladder_detector.get_collider() != _attached_ladder:
|
||||
|
@ -311,9 +303,14 @@ func _process_climbing(delta: float) -> void:
|
|||
if sign(_attached_ladder.middle - global_position.x) != horizontal_dir:
|
||||
global_position.x -= graphics.scale.x * 3.0
|
||||
state_chart.send_event("ladder_jump")
|
||||
if Input.is_action_just_pressed("shoot"):
|
||||
elif Input.is_action_just_pressed("shoot"):
|
||||
global_position.x -= graphics.scale.x * 3.0
|
||||
state_chart.send_event("ladder_detach")
|
||||
if Input.is_action_pressed("ui_down") and is_on_floor():
|
||||
var horizontal_dir = sign(Input.get_axis("ui_left", "ui_right"))
|
||||
if sign(_attached_ladder.middle - global_position.x) != horizontal_dir:
|
||||
global_position.x -= graphics.scale.x * 2.0
|
||||
state_chart.send_event("ladder_detach")
|
||||
|
||||
func _process_jump(delta: float) -> void:
|
||||
if velocity.y >= 0.0:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue