From 9f3861fdfd0e556c3a70c48c98d64cd0f92eadfe Mon Sep 17 00:00:00 2001 From: Sebastian Suciu Date: Thu, 21 Nov 2024 11:06:45 +1100 Subject: [PATCH] Fix #28 --- Scenes and Scripts/Scenes/Player/Player_SCRIPT.gd | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Scenes and Scripts/Scenes/Player/Player_SCRIPT.gd b/Scenes and Scripts/Scenes/Player/Player_SCRIPT.gd index 5f6a7a7a..3ce61e1e 100644 --- a/Scenes and Scripts/Scenes/Player/Player_SCRIPT.gd +++ b/Scenes and Scripts/Scenes/Player/Player_SCRIPT.gd @@ -450,17 +450,16 @@ func takeDamageOverlay(): # Overlay when taking damage tween.tween_property($Head/Camera3D/OverlayLayer/RedOverlay, "self_modulate", Color(1, 0.018, 0, 0.808), 0).from(Color(1, 0.016, 0, 0)) # tween the red overlay's self modulate to red tween.tween_property($Head/Camera3D/OverlayLayer/RedOverlay, "self_modulate", Color(1, 0.016, 0, 0), 0.5) # tween the red overlay's self modulate to red -func _on_respawn(): # A function to respawn the player after death - GAME_STATE = "NORMAL" # set the game state to normal - PlayerData.GAME_STATE = GAME_STATE # set the player data's game state to the game state - func respawnFromDeath(): # A function to respawn the player from death self.position = StartPOS # set the player's position to the start position Health = MaxHealth # set the health to the max health PlayerData.Health = Health # set the player data's health to the health var tween = get_tree().create_tween() # create a tween - tween.connect("finished", _on_respawn, 1) # connect the finished signal to the respawn function + tween.tween_property($Head/Camera3D/DeathScreen/BlackOverlay, "self_modulate", Color(0, 0, 0, 0), 3) # tween the black overlay's self modulate to black + + GAME_STATE = "NORMAL" # set the game state to normal + PlayerData.GAME_STATE = GAME_STATE # set the player data's game state to the game state func _on_death_screen_finished(): # A function to call when the death screen is finished respawnFromDeath() # call the respawn from death function