mirror of
https://github.com/kristoferssolo/FuncIt.git
synced 2025-10-21 19:30:35 +00:00
[Minimal] Timer
This commit is contained in:
parent
1d6cfbea6d
commit
7046a25a11
@ -16,19 +16,19 @@ var clientPhase = {
|
|||||||
"0": {
|
"0": {
|
||||||
"phase_id": 0,
|
"phase_id": 0,
|
||||||
"phase_name": "Movement phase",
|
"phase_name": "Movement phase",
|
||||||
"length": 2,
|
"length": 15,
|
||||||
"start_time": null
|
"start_time": null
|
||||||
},
|
},
|
||||||
"1": {
|
"1": {
|
||||||
"phase_id": 1,
|
"phase_id": 1,
|
||||||
"phase_name": "Weapon adjustment phase",
|
"phase_name": "Weapon adjustment phase",
|
||||||
"length": 2,
|
"length": 20,
|
||||||
"start_time": null
|
"start_time": null
|
||||||
},
|
},
|
||||||
"2": {
|
"2": {
|
||||||
"phase_id": 2,
|
"phase_id": 2,
|
||||||
"phase_name": "Bullet simulation phase",
|
"phase_name": "Bullet simulation phase",
|
||||||
"length": 2,
|
"length": 5,
|
||||||
"start_time": null
|
"start_time": null
|
||||||
},
|
},
|
||||||
"3": {
|
"3": {
|
||||||
|
|||||||
@ -15,7 +15,6 @@ func _ready() -> void:
|
|||||||
if get_tree().is_network_server():
|
if get_tree().is_network_server():
|
||||||
setup_player_positions()
|
setup_player_positions()
|
||||||
Global.start_game(true)
|
Global.start_game(true)
|
||||||
Global.mode = 2
|
|
||||||
|
|
||||||
|
|
||||||
func setup_player_positions() -> void:
|
func setup_player_positions() -> void:
|
||||||
@ -36,6 +35,11 @@ func _player_disconnected(id) -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _process(_delta):
|
func _process(_delta):
|
||||||
|
if Global.get_current_phase()["active"] != null and Global.get_current_phase()["active"]["start_time"] != null:
|
||||||
|
if Global.get_current_phase()["active"]["length"] - abs(OS.get_time()["second"] - Global.get_current_phase()["active"]["start_time"]["second"]) < 10:
|
||||||
|
$controls/timer/time.text = "00:0"+str(Global.get_current_phase()["active"]["length"] - abs(OS.get_time()["second"] - Global.get_current_phase()["active"]["start_time"]["second"]))
|
||||||
|
else:
|
||||||
|
$controls/timer/time.text = "00:"+str(Global.get_current_phase()["active"]["length"] - abs(OS.get_time()["second"] - Global.get_current_phase()["active"]["start_time"]["second"]))
|
||||||
globalActivePhase = Global.get_current_phase()
|
globalActivePhase = Global.get_current_phase()
|
||||||
if globalActivePhase["active"] != null:
|
if globalActivePhase["active"] != null:
|
||||||
phase.text = str(globalActivePhase["active"]["phase_name"])
|
phase.text = str(globalActivePhase["active"]["phase_name"])
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user