disable collision while drowning (fixes #133)

This commit is contained in:
Haze Weathers 2023-06-30 19:03:16 -04:00
parent 85478370b4
commit 2974cce19e
2 changed files with 11 additions and 1 deletions

View file

@ -54,6 +54,7 @@ onready var pushable_detector: RayCast2D = $"%PushableDetector"
onready var oxygen_timer = $OxygenTimer
onready var low_oxygen_label = $LowOxygenLabel
onready var edge_detector = $Graphics/EdgeDetector
onready var body_shape: CollisionShape2D = $"%BodyShape"
# OVERRIDES #
func _ready() -> void:
@ -274,6 +275,13 @@ func _on_Respawn_state_entered() -> void:
func _on_Edge_state_entered():
animation_player.play("edge")
func _on_Inactive_state_entered() -> void:
body_shape.disabled = true
func _on_Inactive_state_exited() -> void:
body_shape.disabled = false
# STATE PROCESSING #
## when on ground
func _process_grounded(delta: float) -> void: