Fixed round resetting

This commit is contained in:
Paul Black 2023-05-23 12:00:25 -06:00
parent f024c3f2ef
commit b8e42872f7
2 changed files with 10 additions and 5 deletions

View file

@ -25,11 +25,12 @@ func _process(delta):
$startLabel.text = Global.HUDStartLabelText $startLabel.text = Global.HUDStartLabelText
$Fatigue.value = Global.fatigue $Fatigue.value = Global.fatigue
$Health.value = Global.playerHealth $Health.value = Global.playerHealth
if not Global.roundInSession: #if not Global.roundInSession:
if Input.is_action_just_pressed("start_game"): if Input.is_action_just_pressed("start_game"):
if Global.teddyAuthorityID == 1: print("Player with authority ID of " + str(Global.teddyAuthorityID) + " attempted to restart the round!")
restart_round() if Global.teddyAuthorityID == 1:
rpc("restart_round") restart_round()
rpc("restart_round")
if Global.mapName == "Tutorial": if Global.mapName == "Tutorial":
if not Global.playerDisable: if not Global.playerDisable:
tutorial() tutorial()

View file

@ -1,8 +1,12 @@
extends Node extends Node
@onready var mapNode = get_node("/root/tutorial")
var mapPath = "res://scenes/tutorial.tscn"
var audio_stream_player = AudioStreamPlayer.new() var audio_stream_player = AudioStreamPlayer.new()
func _ready(): func _ready():
Global.currentMapNode = mapNode
Global.currentMapPath = mapPath
Global.playerHealth = 100 Global.playerHealth = 100
Global.fatigue = 100 Global.fatigue = 100
Global.roundTimer = 90.0 Global.roundTimer = 90.0