From 002737706b088160c62645a9f1e3f7e01b388e6e Mon Sep 17 00:00:00 2001 From: Haze Weathers Date: Sat, 14 Oct 2023 13:09:58 -0400 Subject: [PATCH] make player TRULY intangible when dying/teleporting --- objects/player/player.gd | 7 +++++++ objects/player/player.tscn | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/objects/player/player.gd b/objects/player/player.gd index 4febe9a..d827d1f 100644 --- a/objects/player/player.gd +++ b/objects/player/player.gd @@ -62,6 +62,7 @@ onready var low_oxygen_label = $"%LowOxygenLabel" onready var edge_detector = $Graphics/EdgeDetector onready var body_shape: CollisionShape2D = $"%BodyShape" onready var cfox: Sprite = $"%CFox" +onready var hitbox: Area2D = $"%Hitbox" # OVERRIDES # func _ready() -> void: @@ -312,11 +313,17 @@ func _on_Edge_state_entered(): func _on_Inactive_state_entered() -> void: body_shape.disabled = true + hitbox.monitorable = false + hitbox.monitoring = false func _on_Inactive_state_exited() -> void: body_shape.disabled = false + hitbox.monitorable = true + hitbox.monitoring = true func _on_Teleporting_state_entered() -> void: + hitbox.monitorable = false + hitbox.monitoring = false velocity = Vector2.ZERO Audio.play_sound(Audio.a_teleport, Audio.ac_jump) animation_player.play("idle") diff --git a/objects/player/player.tscn b/objects/player/player.tscn index a7131ff..6da76fb 100644 --- a/objects/player/player.tscn +++ b/objects/player/player.tscn @@ -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="_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/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_jump"] [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_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_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_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_Teleporting_state_entered"] [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/Dead" to="." method="_on_Dead_state_entered"]