Skip to content

Commit d17132d

Browse files
committed
feat: reduce number of sizes
To keep things simple, there is now only a "small" size of 8, "medium" size of 32, and "big" size of 128.
1 parent 7c03e77 commit d17132d

File tree

3 files changed

+18
-22
lines changed

3 files changed

+18
-22
lines changed

models/array_model.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ signal removed(i)
55
signal swapped(i, j)
66
signal sorted(i, j)
77

8-
const DEFAULT_SIZE = 16
8+
const DEFAULT_SIZE = 32
99
enum DATA_TYPES {
1010
RANDOM_UNIQUE,
1111
TRUE_RANDOM,

scenes/levels.tscn

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,16 @@ size_flags_horizontal = 3
8585

8686
[node name="Display" type="MarginContainer" parent="Levels/Level/Right"]
8787
margin_right = 616.0
88-
margin_bottom = 431.0
88+
margin_bottom = 475.0
8989
size_flags_vertical = 3
9090
script = ExtResource( 3 )
9191

9292
[node name="TypesContainer" type="MarginContainer" parent="Levels/Level/Right/Display"]
9393
visible = false
9494
margin_left = 288.0
95-
margin_top = 195.0
95+
margin_top = 217.0
9696
margin_right = 328.0
97-
margin_bottom = 235.0
97+
margin_bottom = 257.0
9898
size_flags_horizontal = 4
9999
size_flags_vertical = 4
100100
script = ExtResource( 3 )
@@ -111,16 +111,16 @@ size_flags_vertical = 4
111111
margin_left = 20.0
112112
margin_top = 20.0
113113
margin_right = 596.0
114-
margin_bottom = 411.0
114+
margin_bottom = 455.0
115115

116116
[node name="Info" type="HBoxContainer" parent="Levels/Level/Right"]
117-
margin_top = 439.0
117+
margin_top = 483.0
118118
margin_right = 616.0
119119
margin_bottom = 613.0
120120

121121
[node name="ControlsContainer" type="MarginContainer" parent="Levels/Level/Right/Info"]
122122
margin_right = 405.0
123-
margin_bottom = 174.0
123+
margin_bottom = 130.0
124124
size_flags_horizontal = 3
125125
size_flags_stretch_ratio = 2.0
126126
script = ExtResource( 3 )
@@ -129,23 +129,23 @@ script = ExtResource( 3 )
129129
margin_left = 20.0
130130
margin_top = 20.0
131131
margin_right = 385.0
132-
margin_bottom = 154.0
132+
margin_bottom = 110.0
133133
size_flags_vertical = 1
134134
text = "These are the controls for the level."
135135
autowrap = true
136136

137137
[node name="ScoresContainer" type="MarginContainer" parent="Levels/Level/Right/Info"]
138138
margin_left = 413.0
139139
margin_right = 616.0
140-
margin_bottom = 174.0
140+
margin_bottom = 130.0
141141
size_flags_horizontal = 3
142142
script = ExtResource( 3 )
143143

144144
[node name="Scores" type="VBoxContainer" parent="Levels/Level/Right/Info/ScoresContainer"]
145145
margin_left = 20.0
146146
margin_top = 20.0
147147
margin_right = 183.0
148-
margin_bottom = 154.0
148+
margin_bottom = 110.0
149149

150150
[node name="Header" type="HBoxContainer" parent="Levels/Level/Right/Info/ScoresContainer/Scores"]
151151
margin_right = 163.0
@@ -167,26 +167,22 @@ align = 2
167167
[node name="Data" type="HBoxContainer" parent="Levels/Level/Right/Info/ScoresContainer/Scores"]
168168
margin_top = 27.0
169169
margin_right = 163.0
170-
margin_bottom = 134.0
170+
margin_bottom = 90.0
171171

172172
[node name="Sizes" type="Label" parent="Levels/Level/Right/Info/ScoresContainer/Scores/Data"]
173173
margin_right = 30.0
174-
margin_bottom = 107.0
174+
margin_bottom = 63.0
175175
text = "8
176-
16
177176
32
178-
64
179177
128"
180178

181179
[node name="Times" type="Label" parent="Levels/Level/Right/Info/ScoresContainer/Scores/Data"]
182180
margin_left = 38.0
183181
margin_right = 163.0
184-
margin_bottom = 107.0
182+
margin_bottom = 63.0
185183
size_flags_horizontal = 3
186184
text = "INF
187185
INF
188-
INF
189-
INF
190186
INF"
191187
align = 2
192188
uppercase = true

scripts/levels.gd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const LEVELS = [
1313
OddEvenSort,
1414
]
1515

16-
const MIN_WAIT = 1.0 / 32 # Should be greater than maximum frame time
16+
const MIN_WAIT = 1.0 / 64
1717
const MAX_WAIT = 4
1818
const MIN_SIZE = 8
1919
const MAX_SIZE = 128
@@ -82,15 +82,15 @@ func _input(event):
8282
if event.is_action_pressed("ui_right", true):
8383
_switch_level(_index + 1)
8484
if event.is_action_pressed("bigger"):
85-
_size = min(_size * 2, MAX_SIZE)
85+
_size = min(_size * 4, MAX_SIZE)
8686
_reload()
8787
if event.is_action_pressed("smaller"):
88-
_size = max(_size / 2, MIN_SIZE)
88+
_size = max(_size / 4, MIN_SIZE)
8989
_reload()
9090
if event.is_action_pressed("faster"):
91-
$Timer.wait_time = max($Timer.wait_time / 2, MIN_WAIT)
91+
$Timer.wait_time = max($Timer.wait_time / 4, MIN_WAIT)
9292
if event.is_action_pressed("slower"):
93-
$Timer.wait_time = min($Timer.wait_time * 2, MAX_WAIT)
93+
$Timer.wait_time = min($Timer.wait_time * 4, MAX_WAIT)
9494
if event.is_action_pressed("change_data"):
9595
AudioServer.set_bus_mute(AudioServer.get_bus_index("Master"), true)
9696
$Level/Right/Display/ArrayView.hide()

0 commit comments

Comments
 (0)