-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathBootLoader.gd
More file actions
59 lines (47 loc) · 1.67 KB
/
BootLoader.gd
File metadata and controls
59 lines (47 loc) · 1.67 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
extends Node2D
func _ready():
add_load_full_game_button()
add_load_title_button()
add_load_level_button(1)
add_load_level_button(2)
add_load_level_button(5)
add_load_level_button(3)
add_load_sound_effect_button()
add_load_music_button()
func add_load_full_game_button():
var button = make_button("Load Full Game")
button.connect("pressed", self, "load_full_game")
$BootLoader.add_child(button)
func load_full_game():
get_tree().change_scene("res://LevelManager.tscn")
func add_load_sound_effect_button():
var button = make_button("Load Sound Effect Debug")
button.connect("pressed", self, "load_sound_effects")
$BootLoader.add_child(button)
func load_sound_effects():
get_tree().change_scene("res://SoundEffect.tscn")
func add_load_music_button():
var button = make_button("Load Music Debug")
button.connect("pressed", self, "load_music")
$BootLoader.add_child(button)
func load_music():
get_tree().change_scene("res://Music.tscn")
func add_load_title_button():
var button = make_button("Load Title")
button.connect("pressed", self, "load_title")
$BootLoader.add_child(button)
func load_title():
get_tree().change_scene("res://Title.tscn")
func add_load_level_button(n):
var button = make_button("Load Level %s" % n)
button.connect("pressed", self, "load_level", ["Level%s" % n])
$BootLoader.add_child(button)
func load_level(level_name):
get_tree().change_scene("res://Levels/" + level_name + ".tscn")
func make_button(text):
var button = Button.new()
button.size_flags_horizontal = button.SIZE_EXPAND_FILL
button.size_flags_vertical = button.SIZE_EXPAND_FILL
button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND
button.text = text
return button