fixed a few bugs with drowning
This commit is contained in:
parent
13f01397ef
commit
843561915c
2 changed files with 15 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue