Skip to content

Commit 46c827b

Browse files
committed
feat: add instructions to level information
Finalized bubble sort description for release and added simple instructions to the right of the description. Also swapped right and left arrow key actions in response to player feedback.
1 parent ace4ce3 commit 46c827b

File tree

4 files changed

+31
-10
lines changed

4 files changed

+31
-10
lines changed

assets/levels.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"BUBBLE SORT":
3-
{
4-
"about": "Bubble sort is a simple sorting algorithm, typically the first taught in introductory computer science classes."
5-
}
2+
"BUBBLE SORT":
3+
{
4+
"about": "Bubble sort iterates through the array and looks at each pair of elements, swapping them if they are out of order. When it has gone through the entire array without swapping a single pair, it has finished. Though simple to understand, bubble sort is hopelessly inefficient on all but the smallest of arrays."
5+
}
66
}

project.godot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ ui_down={
104104
}
105105
swap={
106106
"deadzone": 0.5,
107-
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null)
107+
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null)
108108
]
109109
}
110110
no_swap={
111111
"deadzone": 0.5,
112-
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null)
112+
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null)
113113
]
114114
}
115115

scenes/levels.tscn

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
[ext_resource path="res://scripts/border.gd" type="Script" id=3]
66

77
[node name="Viewport" type="MarginContainer"]
8+
anchor_top = 0.00114754
89
anchor_right = 1.0
9-
anchor_bottom = 1.0
10+
anchor_bottom = 1.00115
1011
theme = ExtResource( 2 )
1112
custom_constants/margin_right = 30
1213
custom_constants/margin_top = 30
@@ -60,12 +61,32 @@ margin_bottom = 1020.0
6061
size_flags_vertical = 3
6162
script = ExtResource( 3 )
6263

63-
[node name="Info" type="Label" parent="LevelSelect/Preview/InfoBorder"]
64+
[node name="Info" type="HBoxContainer" parent="LevelSelect/Preview/InfoBorder"]
6465
margin_left = 20.0
6566
margin_top = 20.0
6667
margin_right = 1352.0
6768
margin_bottom = 352.0
68-
size_flags_vertical = 1
69+
custom_constants/separation = 50
70+
71+
[node name="Description" type="Label" parent="LevelSelect/Preview/InfoBorder/Info"]
72+
margin_right = 810.0
73+
margin_bottom = 332.0
74+
rect_min_size = Vector2( 810, 0 )
75+
size_flags_vertical = 3
76+
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse luctus lorem felis, in imperdiet mauris faucibus in. Vestibulum interdum mi at arcu congue congue. Cras sodales mauris odio, eget iaculis dolor tempor quis. Suspendisse nec iaculis sapien, eu sollicitudin orci. Nulla volutpat pellentesque ex nec cursus."
77+
autowrap = true
78+
79+
[node name="Instructions" type="Label" parent="LevelSelect/Preview/InfoBorder/Info"]
80+
margin_left = 860.0
81+
margin_right = 1332.0
82+
margin_bottom = 332.0
83+
rect_min_size = Vector2( 450, 0 )
84+
size_flags_horizontal = 3
85+
size_flags_vertical = 3
86+
text = "INSTRUCTIONS
87+
88+
LEFT ARROW: SWAP
89+
RIGHT ARROW: DON'T SWAP"
6990
autowrap = true
7091

7192
[node name="Timer" type="Timer" parent="."]

scripts/levels.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func _ready():
2121

2222
func _on_Button_focus_changed():
2323
var name = get_focus_owner().text
24-
$Preview/InfoBorder/Info.text = levels[name]["about"]
24+
$Preview/InfoBorder/Info/Description.text = levels[name]["about"]
2525
level = get_level(name).new(ArrayModel.new(10))
2626
level.active = false
2727
# Start over when simulation is finished

0 commit comments

Comments
 (0)