fixed a few bugs with drowning

This commit is contained in:
pennyrigate 2023-06-30 06:00:29 -04:00
parent 13f01397ef
commit 843561915c
2 changed files with 15 additions and 1 deletions

View file

@ -262,6 +262,7 @@ func _on_Dead_state_entered() -> void:
func _on_Drowning_state_entered() -> void:
state_chart.send_event("died")
velocity = Vector2.ZERO
animation_player.play("drown")
func _on_Respawn_state_entered() -> void:
@ -400,7 +401,7 @@ func _process_movement(delta: float) -> void:
func _process_floating_up(delta: float) -> void:
graphics.global_position.y -= 50.0 * delta
var sprite_sector = Game.get_sector(Vector2(global_position.x, graphics.global_position.y))
var sprite_sector = Game.get_sector(Vector2(global_position.x, graphics.global_position.y - 20))
if sprite_sector != Game.current_sector:
graphics.visible = false
graphics.position = Vector2.ZERO