-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnode.gd
More file actions
90 lines (71 loc) · 2.06 KB
/
node.gd
File metadata and controls
90 lines (71 loc) · 2.06 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
extends Node
func initialise_game():
if ResourceLoader.exists("user://savefile.tres") == true:
print("Savefile Exists; Skipping Initialisation")
else:
var data = SaveData.new()
data.savename = "Nardo Polo"
data.saveunlockedlevels = 1
data.mastervol = 0
data.musicvol = 0
data.beatenlevels = 0
ResourceSaver.save(data, "user://savefile.tres")
print("Savefile not found; Initialising")
func loadData():
var data = ResourceLoader.load("user://savefile.tres") as SaveData
Global.unlockedlevels = data.saveunlockedlevels
Global.playername = data.savename
Global.beatenlevels = data.beatenlevels
AudioServer.set_bus_volume_db(0, data.mastervol)
AudioServer.set_bus_volume_db(1, data.musicvol)
if data.fullscreen == true:
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
if data.fullscreen == false:
pass
print("Loaded with name " + Global.playername + " and " + str(Global.unlockedlevels) + " unlocked levels")
func _ready():
randomize()
initialise_game()
loadData()
func uiHover():
$Uihover.play()
func uiPress():
$Uipress.play()
func uiRelease():
$Uirelease.play()
func _on_ng_pressed() -> void :
get_tree().change_scene_to_file("res://worldmap.tscn")
func _on_opt_pressed() -> void :
get_tree().change_scene_to_file("res://options.tscn")
func _on_quit_pressed() -> void :
$quit.disabled = true
$opt.disabled = true
$ng.disabled = true
$Baa.pitch_scale = randf_range(0.7, 1.3)
$Baa.play()
func _on_ng_mouse_entered() -> void :
uiHover()
func _on_opt_mouse_entered() -> void :
uiHover()
func _on_quit_mouse_entered() -> void :
uiHover()
func _on_ng_button_up() -> void :
uiRelease()
func _on_ng_button_down() -> void :
uiPress()
func _on_opt_button_up() -> void :
uiRelease()
func _on_opt_button_down() -> void :
uiPress()
func _on_quit_button_down() -> void :
uiPress()
func _on_quit_button_up() -> void :
uiRelease()
func _on_baa_finished() -> void :
get_tree().quit()
func _on_mods_button_down() -> void:
uiPress()
func _on_mods_button_up() -> void:
uiRelease()
func _on_mods_pressed() -> void:
print("niganigfnadi")