19 lines
472 B
GDScript
19 lines
472 B
GDScript
extends Node
|
|
|
|
var deathTimer = 0
|
|
var teddyNode
|
|
|
|
func _ready():
|
|
Global.playerAlive = false
|
|
if Global.roundInSession:
|
|
Global.HUDPlayerDied = true
|
|
|
|
|
|
func _process(delta):
|
|
if deathTimer < 100:
|
|
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
|