Skip to content

Commit

Permalink
Fix #28
Browse files Browse the repository at this point in the history
  • Loading branch information
sebashtioon authored Nov 21, 2024
1 parent 2b2f61e commit 9f3861f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Scenes and Scripts/Scenes/Player/Player_SCRIPT.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9f3861f

Please sign in to comment.