File tree 6 files changed +24
-1
lines changed
6 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 6
6
publish
7
7
8
8
logs /
9
+
10
+ .DS_Store
Original file line number Diff line number Diff line change 32
32
FP_DUAL = :dual
33
33
FP_TRI = :tri
34
34
FP_QUAD = :quad
35
+
36
+ DIFFICULTY = [ :easy , :normal , :hard ]
Original file line number Diff line number Diff line change @@ -33,12 +33,15 @@ def load_settings(args)
33
33
v = true
34
34
elsif v == "false"
35
35
v = false
36
+ else
37
+ v = v . to_sym
36
38
end
37
39
args . state . setting [ k . to_sym ] = v
38
40
end
39
41
else
40
42
args . state . setting . sfx = true
41
43
args . state . setting . fullscreen = false
44
+ args . state . setting . difficulty = :normal
42
45
end
43
46
44
47
if args . state . setting . fullscreen
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ def text_for_setting_val(val)
99
99
when false
100
100
text ( :off )
101
101
else
102
- val
102
+ text ( val ) || val
103
103
end
104
104
end
105
105
end
Original file line number Diff line number Diff line change @@ -5,6 +5,18 @@ def tick_settings(args)
5
5
a_s = args . state
6
6
7
7
options = [
8
+ {
9
+ key : :difficulty ,
10
+ kind : :toggle ,
11
+ setting_val : a_s . setting . difficulty ,
12
+ on_select : -> ( args ) do
13
+ current_index = DIFFICULTY . index ( a_s . setting . difficulty )
14
+ current_index = ( current_index + 1 ) % DIFFICULTY . length
15
+ GameSetting . save_after ( args ) do |args |
16
+ a_s . setting . difficulty = DIFFICULTY [ current_index ]
17
+ end
18
+ end
19
+ } ,
8
20
{
9
21
key : :sfx ,
10
22
kind : :toggle ,
Original file line number Diff line number Diff line change 40
40
sfx : "Sound Effects" ,
41
41
start : "Start" ,
42
42
win : "You Win!" ,
43
+ difficulty : "Difficulty" ,
44
+ easy : "Grandma's House" ,
45
+ normal : "The Real World" ,
46
+ hard : "The Hunger Games" ,
43
47
}
44
48
45
49
# Gets the text for the passed in `key`. Raises if it does not exist. We don't
You can’t perform that action at this time.
0 commit comments