project_teddy/scripts/death.gd

24 lines
557 B
GDScript3
Raw Normal View History

extends Node
var deathTimer = 0
var teddyNode
func _ready():
2023-03-06 00:35:22 -07:00
Global.playerAlive = false
if Global.roundInSession:
Global.HUDPlayerDied = true
func _process(delta):
2023-03-16 13:37:17 -06:00
if Global.gamemode == "Runner":
if Global.iAmRunner:
Global.runnerDead = true
if deathTimer < 100:
2023-03-06 19:07:22 -07:00
deathTimer = deathTimer + (10 * Global.respawnTimeModifier) * delta
if deathTimer > 100:
deathTimer = 0
Global.playerPleaseRespawn = true # Used so the Teddy script will know to reset variables and position of the player
self.queue_free()
$deathBar.value = deathTimer
2023-03-16 13:37:17 -06:00