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 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")