ready for live testing!
This commit is contained in:
parent
42d238a2f8
commit
e3200c8416
5 changed files with 139 additions and 25 deletions
|
|
@ -4,6 +4,7 @@ extends Node3D
|
|||
|
||||
#region Variables
|
||||
#Signals
|
||||
signal panic_drop()
|
||||
|
||||
#Enums
|
||||
|
||||
|
|
@ -17,6 +18,11 @@ extends Node3D
|
|||
@export var accept_time_limit : float = 20
|
||||
@export_group("Node References")
|
||||
@export var debug_ui_label : Label
|
||||
@export_subgroup("GameUI")
|
||||
@export var current_player_label : Label
|
||||
@export var next_up_label: Label
|
||||
@export var timer_bar : TextureProgressBar
|
||||
@export var turn_alert_label : Label
|
||||
|
||||
#Onready Variables
|
||||
|
||||
|
|
@ -35,6 +41,9 @@ func _ready():
|
|||
|
||||
func _process(delta):
|
||||
turn_timer -= delta
|
||||
if(turn_timer<0 and turn_started):
|
||||
panic_drop.emit()
|
||||
turn_started = false
|
||||
if(current_player == "" or turn_timer<0):
|
||||
current_player = ""
|
||||
#switch to the next players turn (if anyone is in the queue)
|
||||
|
|
@ -43,12 +52,26 @@ func _process(delta):
|
|||
player_queue.erase(current_player)
|
||||
turn_started = false
|
||||
turn_timer = accept_time_limit
|
||||
debug_ui_label.text = "Current Player: " + current_player + "\nTurn Started?: " + str(turn_started) + "\nTime Left: " + str(round(turn_timer)) + "\nQueue Size: " + str(player_queue.size())
|
||||
#debug_ui_label.text = "Current Player: " + current_player + "\nTurn Started?: " + str(turn_started) + "\nTime Left: " + str(round(turn_timer)) + "\nQueue Size: " + str(player_queue.size())
|
||||
|
||||
current_player_label.text ="Current Player: " + current_player
|
||||
next_up_label.text = "Up Next: " + str(player_queue)
|
||||
|
||||
if(turn_timer < 0 && player_queue.size() == 0):
|
||||
turn_alert_label.text = "Type !join_queue to play"
|
||||
timer_bar.value = 0
|
||||
elif(turn_timer > 0 and not turn_started):
|
||||
turn_alert_label.text = current_player+ " you're up! Type !start_turn"
|
||||
timer_bar.value = turn_timer/ accept_time_limit
|
||||
elif(turn_timer > 0 and turn_started):
|
||||
turn_alert_label.text = "Use !move, !rotate, !camera and !drop to play your turn"
|
||||
timer_bar.value = turn_timer/ turn_time_limit
|
||||
|
||||
#endregion
|
||||
|
||||
#region Signal methods
|
||||
|
||||
func _on_twitch_link_drop_block():
|
||||
turn_timer = 0
|
||||
#endregion
|
||||
|
||||
#region Other methods (please try to separate and organise!)
|
||||
|
|
@ -58,5 +81,4 @@ func _process(delta):
|
|||
|
||||
|
||||
|
||||
func _on_twitch_link_drop_block():
|
||||
turn_timer = 0
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue