wip menu
This commit is contained in:
14
Main.gd
14
Main.gd
@@ -1,14 +1,20 @@
|
||||
extends Node
|
||||
|
||||
func _ready():
|
||||
get_tree().paused = true
|
||||
|
||||
func start_game():
|
||||
print("Game starting")
|
||||
$Menu.set_visible(false)
|
||||
yield($Countdown.start(), "race_started")
|
||||
Global.race_started = true
|
||||
if not Global.race_started:
|
||||
print("Game starting")
|
||||
Global.race_started = true
|
||||
$GUI.set_visible(true)
|
||||
yield($Countdown.start(), "completed")
|
||||
get_tree().paused = false
|
||||
|
||||
func pause_game():
|
||||
$Menu.set_visible(true)
|
||||
Global.race_started = false
|
||||
get_tree().paused = true
|
||||
|
||||
func _input(event):
|
||||
if event.is_action_pressed("ui_cancel"):
|
||||
|
||||
Reference in New Issue
Block a user