make player TRULY intangible when dying/teleporting

This commit is contained in:
Haze Weathers 2023-10-14 13:09:58 -04:00
parent d1d8ff89e4
commit 002737706b
2 changed files with 9 additions and 2 deletions

View file

@ -62,6 +62,7 @@ onready var low_oxygen_label = $"%LowOxygenLabel"
onready var edge_detector = $Graphics/EdgeDetector onready var edge_detector = $Graphics/EdgeDetector
onready var body_shape: CollisionShape2D = $"%BodyShape" onready var body_shape: CollisionShape2D = $"%BodyShape"
onready var cfox: Sprite = $"%CFox" onready var cfox: Sprite = $"%CFox"
onready var hitbox: Area2D = $"%Hitbox"
# OVERRIDES # # OVERRIDES #
func _ready() -> void: func _ready() -> void:
@ -312,11 +313,17 @@ func _on_Edge_state_entered():
func _on_Inactive_state_entered() -> void: func _on_Inactive_state_entered() -> void:
body_shape.disabled = true body_shape.disabled = true
hitbox.monitorable = false
hitbox.monitoring = false
func _on_Inactive_state_exited() -> void: func _on_Inactive_state_exited() -> void:
body_shape.disabled = false body_shape.disabled = false
hitbox.monitorable = true
hitbox.monitoring = true
func _on_Teleporting_state_entered() -> void: func _on_Teleporting_state_entered() -> void:
hitbox.monitorable = false
hitbox.monitoring = false
velocity = Vector2.ZERO velocity = Vector2.ZERO
Audio.play_sound(Audio.a_teleport, Audio.ac_jump) Audio.play_sound(Audio.a_teleport, Audio.ac_jump)
animation_player.play("idle") animation_player.play("idle")

View file

@ -1604,8 +1604,8 @@ align = 1
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne" to="." method="reset_fall_speed"] [connection signal="state_entered" from="StateChart/Root/Movement/Airborne" to="." method="reset_fall_speed"]
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne" to="." method="_on_Airborne_state_entered"] [connection signal="state_entered" from="StateChart/Root/Movement/Airborne" to="." method="_on_Airborne_state_entered"]
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne" to="." method="_process_gravity"] [connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne" to="." method="_process_gravity"]
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Jump" to="." method="_process_jump"]
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Jump" to="." method="_process_horizontal_movement"] [connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Jump" to="." method="_process_horizontal_movement"]
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Jump" to="." method="_process_jump"]
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne/Jump/NormalJump" to="." method="_on_NormalJump_state_entered"] [connection signal="state_entered" from="StateChart/Root/Movement/Airborne/Jump/NormalJump" to="." method="_on_NormalJump_state_entered"]
[connection signal="state_exited" from="StateChart/Root/Movement/Airborne/Jump/NormalJump" to="." method="_on_NormalJump_state_exited"] [connection signal="state_exited" from="StateChart/Root/Movement/Airborne/Jump/NormalJump" to="." method="_on_NormalJump_state_exited"]
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne/Jump/LadderJump" to="." method="_on_LadderJump_state_entered"] [connection signal="state_entered" from="StateChart/Root/Movement/Airborne/Jump/LadderJump" to="." method="_on_LadderJump_state_entered"]
@ -1624,8 +1624,8 @@ align = 1
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Climbing" to="." method="_process_climbing"] [connection signal="state_physics_processing" from="StateChart/Root/Movement/Climbing" to="." method="_process_climbing"]
[connection signal="state_entered" from="StateChart/Root/Movement/Inactive" to="." method="_on_Inactive_state_entered"] [connection signal="state_entered" from="StateChart/Root/Movement/Inactive" to="." method="_on_Inactive_state_entered"]
[connection signal="state_exited" from="StateChart/Root/Movement/Inactive" to="." method="_on_Inactive_state_exited"] [connection signal="state_exited" from="StateChart/Root/Movement/Inactive" to="." method="_on_Inactive_state_exited"]
[connection signal="state_entered" from="StateChart/Root/Movement/Teleporting" to="." method="_on_Teleporting_state_entered"]
[connection signal="state_entered" from="StateChart/Root/Movement/Teleporting" to="." method="_on_Inactive_state_entered"] [connection signal="state_entered" from="StateChart/Root/Movement/Teleporting" to="." method="_on_Inactive_state_entered"]
[connection signal="state_entered" from="StateChart/Root/Movement/Teleporting" to="." method="_on_Teleporting_state_entered"]
[connection signal="state_exited" from="StateChart/Root/Movement/Teleporting" to="." method="_on_Inactive_state_exited"] [connection signal="state_exited" from="StateChart/Root/Movement/Teleporting" to="." method="_on_Inactive_state_exited"]
[connection signal="state_entered" from="StateChart/Root/Health/Respawn" to="." method="_on_Respawn_state_entered"] [connection signal="state_entered" from="StateChart/Root/Health/Respawn" to="." method="_on_Respawn_state_entered"]
[connection signal="state_entered" from="StateChart/Root/Health/Dead" to="." method="_on_Dead_state_entered"] [connection signal="state_entered" from="StateChart/Root/Health/Dead" to="." method="_on_Dead_state_entered"]