-
Notifications
You must be signed in to change notification settings - Fork 0
/
Root.gd
43 lines (29 loc) · 809 Bytes
/
Root.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
extends Control
export (PackedScene) var Main
func _ready():
get_tree().set_pause(true)
func _process(_delta):
if Gamestate.game_over:
get_tree().set_pause(true)
if $Main:
$Main.queue_free()
$GameOver.visible = true
$GameOver/Score.text = "SCORE: %d" % Gamestate.score
func _on_RestartButton_button_up():
Gamestate.score = 0
Gamestate.game_over = false
$GameOver.visible = false
var main = Main.instance()
add_child(main)
get_tree().set_pause(false)
func _on_StartButton_pressed():
$Main.visible = true
$TitleScreen.visible = false
$Tutorial.visible = false
get_tree().set_pause(false)
func _on_TutorialButton_pressed():
$Tutorial.visible = true
$TitleScreen.visible = false
func _on_TutorialBackButton_pressed():
$Tutorial.visible = false
$TitleScreen.visible = true