-
Notifications
You must be signed in to change notification settings - Fork 0
/
Global.gd
58 lines (46 loc) · 1.49 KB
/
Global.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
extends Node
# Possible choices
##enum trials {ROTATE, DOUBLE, MIRROR, SPIRAL}
#enum cues {COLOR, AUDIO, SYMBOL, SHAKE}
#enum modes {NORMAL, REVERSE, FLIP, RANDOM}
#enum sounds {INSTUMENT, SOUNDS, VOICE, ANIMAL}
#enum symbols {NONE, ARROWS, SHAPES, ANIMAL}
# First time running the game?
var first_run: bool = true
# gaming options and presets to start with
# Trials, Strings: Rotate, Double, Mirror, Spiral
var trials: Array = [] # none at start
# Cues for Buttons, Strings:
# Color: Buttons flash if set
# Sounds: Piano, Violin, Speech, Animal
# Symbols: None, Arrows, Shapes, Animals
# Vibration: Use vibration if available
var cues: Array = ["Color", "Piano"]
# Accessibility options
var access: Array = ["Speech", "Subtitle", "Slow", "BigFonts"]
# Available Modes: Normal, Reverse, Flip, Random
var mode: String = "Normal" # normal
# volume options
var min_vol: int = 0
var max_vol: int = 100
var volume: int = 50 # range 0-100
# Update constants
func update():
if "DoubleTimer" in access:
Numbers.timerFactor *= 2
if Settings.mode == "Reverse":
Numbers.playDirection = -1 # reverse
if Settings.mode == "Flip":
Numbers.playDirection *= -1 # flip direction
if Settings.mode == "Random":
Numbers.playDirection *= _randomOne() #random
pass
func _ready():
if Settings.first_run:
get_tree().change_scene("res://scenes/InputScreen.tscn")
else:
get_tree().change_scene("res://scenes/TitleScreen.tscn")
#Generates a -1 or +1 only
func _randomOne():
randomize()
return (randi()%2) * 2 - 1