detach from splat early by pressing 'grab'/'B' button
This commit is contained in:
parent
330ed25153
commit
1895b3b10b
4 changed files with 19 additions and 2 deletions
|
@ -28,12 +28,12 @@ tile_map_data = PackedByteArray("AAAAAAsAAAAAAAAAAAABAAsAAAAAAAAAAAACAAsAAAAAAAA
|
||||||
tile_set = ExtResource("2_dj7w1")
|
tile_set = ExtResource("2_dj7w1")
|
||||||
|
|
||||||
[node name="Lashy" parent="." instance=ExtResource("4_gykx6")]
|
[node name="Lashy" parent="." instance=ExtResource("4_gykx6")]
|
||||||
position = Vector2(8, 96)
|
position = Vector2(144, 112)
|
||||||
launch_power = 300.0
|
launch_power = 300.0
|
||||||
idle_radius = 6.0
|
idle_radius = 6.0
|
||||||
|
|
||||||
[node name="Player" parent="." instance=ExtResource("5_5v7mr")]
|
[node name="Player" parent="." instance=ExtResource("5_5v7mr")]
|
||||||
position = Vector2(120, 144)
|
position = Vector2(96, 136)
|
||||||
|
|
||||||
[node name="Spring" parent="." instance=ExtResource("6_tlqas")]
|
[node name="Spring" parent="." instance=ExtResource("6_tlqas")]
|
||||||
position = Vector2(32, 72)
|
position = Vector2(32, 72)
|
||||||
|
|
|
@ -58,6 +58,10 @@ func _physics_process(delta: float) -> void:
|
||||||
func _unhandled_input(event: InputEvent) -> void:
|
func _unhandled_input(event: InputEvent) -> void:
|
||||||
if event.is_action_pressed(&"jump"):
|
if event.is_action_pressed(&"jump"):
|
||||||
state_chart.send_event(&"jump_pressed")
|
state_chart.send_event(&"jump_pressed")
|
||||||
|
if event.is_action_pressed(&"grab"):
|
||||||
|
state_chart.send_event(&"grab_pressed")
|
||||||
|
if event.is_action_released(&"grab"):
|
||||||
|
state_chart.send_event(&"grab_released")
|
||||||
|
|
||||||
|
|
||||||
func kill() -> void:
|
func kill() -> void:
|
||||||
|
|
|
@ -440,6 +440,13 @@ to = NodePath("..")
|
||||||
event = &"jump_pressed"
|
event = &"jump_pressed"
|
||||||
delay_in_seconds = "0.0"
|
delay_in_seconds = "0.0"
|
||||||
|
|
||||||
|
[node name="on GrabPressed" type="Node" parent="StateChart/Root/Floating/Splat"]
|
||||||
|
editor_description = "Detach from wall early if \"grab\" is pressed."
|
||||||
|
script = ExtResource("7_rgjdc")
|
||||||
|
to = NodePath("../../../Airborne/Falling")
|
||||||
|
event = &"grab_pressed"
|
||||||
|
delay_in_seconds = "0.0"
|
||||||
|
|
||||||
[node name="on TimeOut" type="Node" parent="StateChart/Root/Floating/Splat"]
|
[node name="on TimeOut" type="Node" parent="StateChart/Root/Floating/Splat"]
|
||||||
script = ExtResource("7_rgjdc")
|
script = ExtResource("7_rgjdc")
|
||||||
to = NodePath("../../UnSplat")
|
to = NodePath("../../UnSplat")
|
||||||
|
@ -484,5 +491,6 @@ delay_in_seconds = "0.25"
|
||||||
[connection signal="taken" from="StateChart/Root/Floating/ChompVault/on AnimationFinished" to="." method="_end_chomp_vault"]
|
[connection signal="taken" from="StateChart/Root/Floating/ChompVault/on AnimationFinished" to="." method="_end_chomp_vault"]
|
||||||
[connection signal="state_entered" from="StateChart/Root/Floating/Splat" to="Graphics/Sprite/Splat" method="play"]
|
[connection signal="state_entered" from="StateChart/Root/Floating/Splat" to="Graphics/Sprite/Splat" method="play"]
|
||||||
[connection signal="taken" from="StateChart/Root/Floating/Splat/on JumpPressed" to="." method="_do_splat_launch"]
|
[connection signal="taken" from="StateChart/Root/Floating/Splat/on JumpPressed" to="." method="_do_splat_launch"]
|
||||||
|
[connection signal="taken" from="StateChart/Root/Floating/Splat/on GrabPressed" to="." method="_restore_graphics_rotation"]
|
||||||
[connection signal="state_entered" from="StateChart/Root/Floating/UnSplat" to="Graphics/Sprite/UnSplat" method="play"]
|
[connection signal="state_entered" from="StateChart/Root/Floating/UnSplat" to="Graphics/Sprite/UnSplat" method="play"]
|
||||||
[connection signal="state_exited" from="StateChart/Root/Floating/UnSplat" to="." method="_restore_graphics_rotation"]
|
[connection signal="state_exited" from="StateChart/Root/Floating/UnSplat" to="." method="_restore_graphics_rotation"]
|
||||||
|
|
|
@ -73,6 +73,11 @@ jump={
|
||||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":90,"key_label":0,"unicode":122,"location":0,"echo":false,"script":null)
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":90,"key_label":0,"unicode":122,"location":0,"echo":false,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
grab={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":88,"key_label":0,"unicode":120,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
[layer_names]
|
[layer_names]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue