Added early respawn

This commit is contained in:
Paul Black 2023-05-16 10:00:28 -06:00
parent a41fb082d1
commit 95256fccce
3 changed files with 10 additions and 7 deletions

View file

@ -29,9 +29,9 @@ offset_bottom = 367.0
[node name="badnewsman" type="Label" parent="."]
layout_mode = 0
offset_left = 303.0
offset_top = 208.0
offset_top = 187.0
offset_right = 837.0
offset_bottom = 286.0
text = "Uhhhh I'm sorry to embarrass you but you're dead... I'm sorry to be the bearer of bad news. Maybe you'll do better in your next life huh? You'll be revived once this bar gets to 100%"
offset_bottom = 291.0
text = "Uhhhh I'm sorry to embarrass you but you're dead... I'm sorry to be the bearer of bad news. Maybe you'll do better in your next life huh? You'll be revived once this bar gets to 100% OR YOU CAN PRESS ENTER TO RESPAWN EARLY WITH AMOUNT OF HEALTH IN BAR"
horizontal_alignment = 1
autowrap_mode = 2

View file

@ -26,4 +26,7 @@ func _process(delta):
Global.playerPleaseRespawn = true # Used so the Teddy script will know to reset variables and position of the player
self.queue_free()
$deathBar.value = deathTimer
if Input.is_action_pressed("start_game"):
Global.playerDeathHealth = $deathBar.value
Global.playerPleaseRespawn = true
self.queue_free()

View file

@ -49,10 +49,9 @@ var spawnCotton = false # bullet will change this to true
var addedMenuScene = false # Used for teddy.gd, fixes multiple menu bug
var tutorialCompleted = false # Used in the save file, to know if a play should go to tutorial first
var playerDisable = false # Can be used to disable the player
var playerDeathHealth = 100 # Can be changed by death.gd
func _process(delta):
#if not spawnCoordsInitalized:
# spawnCoordsInitalized = true
spawn_locations()
if godMode:
pass
@ -80,7 +79,7 @@ func player_dead():
func reset_variables():
print("Variables were reset by something")
fatigue = 100
playerHealth = 100
playerHealth = playerDeathHealth
playerDead = false
playerAlive = true
playerPleaseRespawn = false
@ -118,6 +117,7 @@ func reset_variables_hard():
iAmDeadAndInnocent = false
addedMenuScene = false
playerDisable = false
playerDeathHealth = 100
func save_data():
SettingsFile.save_data()