Skip to content

Commit 6092637

Browse files
committed
Minimum Playable Product
This is a "vertical slice" of the game, demonstrating start-to-finish gameplay. There is only one level, bubble sort. [ADDED] - Main menu with bogo sort, start, and credits buttons - Level select page with preview display, description and instructions - Scrolling credits screen with required license texts - Playing and end screens with time-based scoring and visual feedback
2 parents cd0b079 + 43e4f7d commit 6092637

28 files changed

+842
-3
lines changed

CREDITS.md

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
This project is made possible by open source projects; their required copyrights are listed below.
2+
3+
# [Godot](https://godotengine.org)
4+
Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. Copyright (c) 2014-2020 Godot Engine contributors.
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7+
8+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9+
10+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11+
12+
# [FreeType](https://www.freetype.org)
13+
Portions of this software are copyright © 2019 The FreeType
14+
Project (www.freetype.org). All rights reserved.
15+
16+
# [Hack](https://sourcefoundry.org/hack)
17+
The work in the Hack project is Copyright 2018 Source Foundry Authors and licensed under the MIT License
18+
19+
The work in the DejaVu project was committed to the public domain.
20+
21+
Bitstream Vera Sans Mono Copyright 2003 Bitstream Inc. and licensed under the Bitstream Vera License with Reserved Font Names "Bitstream" and "Vera"
22+
23+
### MIT License
24+
25+
Copyright (c) 2018 Source Foundry Authors
26+
27+
Permission is hereby granted, free of charge, to any person obtaining a copy
28+
of this software and associated documentation files (the "Software"), to deal
29+
in the Software without restriction, including without limitation the rights
30+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
31+
copies of the Software, and to permit persons to whom the Software is
32+
furnished to do so, subject to the following conditions:
33+
34+
The above copyright notice and this permission notice shall be included in all
35+
copies or substantial portions of the Software.
36+
37+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
38+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
39+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
40+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
41+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
42+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
43+
SOFTWARE.
44+
45+
### BITSTREAM VERA LICENSE
46+
47+
Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc.
48+
49+
Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions:
50+
51+
The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces.
52+
53+
The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera".
54+
55+
This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names.
56+
57+
The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself.
58+
59+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
60+
61+
Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org.

README.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
11
# Human Computer Simulator
2-
*Gamifying computer science education*
2+
*Human Computer Simulator* is a game where you get to become your
3+
favorite algorithm and or data structure.
4+
5+
# Screenshots
6+
![Level Select](assets/levels.png)
7+
8+
# Download
9+
This software is in an alpha stage of development and I do not plan on
10+
releasing ready-to-run builds until a stable v1.0 release. However, it
11+
is very easy to run it yourself. Just grab the free and open source
12+
[Godot game engine](https://godotengine.org), import the `project.godot`
13+
file, and hit the play button.

assets/hack-regular.ttf

302 KB
Binary file not shown.

assets/icon.png

1.44 KB
Loading

assets/icon.png.import

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="StreamTexture"
5+
path="res://.import/icon.png-b6a7fb2db36edd3d95dc42f1dc8c1c5d.stex"
6+
metadata={
7+
"vram_texture": false
8+
}
9+
10+
[deps]
11+
12+
source_file="res://assets/icon.png"
13+
dest_files=[ "res://.import/icon.png-b6a7fb2db36edd3d95dc42f1dc8c1c5d.stex" ]
14+
15+
[params]
16+
17+
compress/mode=0
18+
compress/lossy_quality=0.7
19+
compress/hdr_mode=0
20+
compress/bptc_ldr=0
21+
compress/normal_map=0
22+
flags/repeat=0
23+
flags/filter=true
24+
flags/mipmaps=false
25+
flags/anisotropic=false
26+
flags/srgb=2
27+
process/fix_alpha_border=true
28+
process/premult_alpha=false
29+
process/HDR_as_SRGB=false
30+
process/invert_color=false
31+
stream=false
32+
size_limit=0
33+
detect_3d=true
34+
svg/scale=1.0

assets/levels.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
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+
}
6+
}

assets/levels.png

232 KB
Loading

assets/splash.png

19.6 KB
Loading

assets/splash.png.import

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="StreamTexture"
5+
path="res://.import/splash.png-8aa957744d9f4b764dd4680b37c88571.stex"
6+
metadata={
7+
"vram_texture": false
8+
}
9+
10+
[deps]
11+
12+
source_file="res://assets/splash.png"
13+
dest_files=[ "res://.import/splash.png-8aa957744d9f4b764dd4680b37c88571.stex" ]
14+
15+
[params]
16+
17+
compress/mode=0
18+
compress/lossy_quality=0.7
19+
compress/hdr_mode=0
20+
compress/bptc_ldr=0
21+
compress/normal_map=0
22+
flags/repeat=0
23+
flags/filter=true
24+
flags/mipmaps=false
25+
flags/anisotropic=false
26+
flags/srgb=2
27+
process/fix_alpha_border=true
28+
process/premult_alpha=false
29+
process/HDR_as_SRGB=false
30+
process/invert_color=false
31+
stream=false
32+
size_limit=0
33+
detect_3d=true
34+
svg/scale=1.0

assets/theme.theme

769 Bytes
Binary file not shown.

levels/bogo_sort.gd

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
extends ComparisonSort
2+
class_name BogoSort
3+
4+
func _init(array).(array):
5+
pass
6+
7+
func check(action):
8+
return true
9+
10+
func next():
11+
array = ArrayModel.new(array.size)
12+
13+
func emphasized(i):
14+
return false

levels/bubble_sort.gd

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
extends ComparisonSort
2+
class_name BubbleSort
3+
4+
var swapped = false
5+
6+
func _init(array).(array):
7+
pass
8+
9+
func check(action):
10+
if array.get(index) > array.get(index + 1):
11+
return action == "swap"
12+
else:
13+
return action == "no_swap"
14+
15+
func next():
16+
if array.get(index) > array.get(index + 1):
17+
array.swap(index, index + 1)
18+
swapped = true
19+
index += 1
20+
if index == array.size - 1:
21+
if not swapped:
22+
emit_signal("done")
23+
index = 0
24+
swapped = false
25+
26+
func emphasized(i):
27+
return i == index or i == index + 1

levels/comparison_sort.gd

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
extends Node
2+
class_name ComparisonSort
3+
4+
signal done
5+
signal mistake
6+
7+
const ACTIONS = ["swap", "no_swap"]
8+
9+
var array: ArrayModel
10+
var index = 0
11+
var timer = Timer.new()
12+
var active = true
13+
14+
func _init(array):
15+
self.array = array
16+
timer.one_shot = true
17+
timer.connect("timeout", self, "_on_Timer_timeout")
18+
add_child(timer)
19+
self.connect("mistake", self, "_on_ComparisonSort_mistake")
20+
21+
func check(action):
22+
pass
23+
24+
func next():
25+
pass
26+
27+
func _on_ComparisonSort_mistake():
28+
active = false
29+
timer.start(1)
30+
31+
func _on_Timer_timeout():
32+
active = true
33+
34+
func _input(event):
35+
if not active:
36+
return
37+
38+
for action in ACTIONS:
39+
if event.is_action_pressed(action):
40+
if check(action):
41+
next()
42+
else:
43+
emit_signal("mistake")

models/array_model.gd

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
"""
2+
A plain old one-dimensional random access array.
3+
"""
4+
5+
extends Reference
6+
class_name ArrayModel
7+
8+
var array = []
9+
var size
10+
11+
func _init(size):
12+
for i in range(1, size + 1):
13+
array.append(i)
14+
array.shuffle()
15+
self.size = size
16+
17+
func get(i):
18+
return array[i]
19+
20+
func is_sorted():
21+
for i in range(size - 1):
22+
if array[i] > array[i + 1]:
23+
return false
24+
return true
25+
26+
func swap(i, j):
27+
var temp = array[i]
28+
array[i] = array[j]
29+
array[j] = temp

project.godot

+101-2
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,116 @@
88

99
config_version=4
1010

11-
_global_script_classes=[ ]
11+
_global_script_classes=[ {
12+
"base": "Reference",
13+
"class": "ArrayModel",
14+
"language": "GDScript",
15+
"path": "res://models/array_model.gd"
16+
}, {
17+
"base": "HBoxContainer",
18+
"class": "ArrayView",
19+
"language": "GDScript",
20+
"path": "res://views/array_view.gd"
21+
}, {
22+
"base": "ComparisonSort",
23+
"class": "BogoSort",
24+
"language": "GDScript",
25+
"path": "res://levels/bogo_sort.gd"
26+
}, {
27+
"base": "ComparisonSort",
28+
"class": "BubbleSort",
29+
"language": "GDScript",
30+
"path": "res://levels/bubble_sort.gd"
31+
}, {
32+
"base": "Node",
33+
"class": "ComparisonSort",
34+
"language": "GDScript",
35+
"path": "res://levels/comparison_sort.gd"
36+
} ]
1237
_global_script_class_icons={
13-
38+
"ArrayModel": "",
39+
"ArrayView": "",
40+
"BogoSort": "",
41+
"BubbleSort": "",
42+
"ComparisonSort": ""
1443
}
1544

1645
[application]
1746

1847
config/name="Human Computer Simulator"
48+
run/main_scene="res://scenes/menu.tscn"
49+
run/low_processor_mode=true
50+
boot_splash/image="res://assets/splash.png"
51+
config/icon="res://assets/icon.png"
52+
53+
[autoload]
54+
55+
scene="*res://scripts/scene.gd"
56+
57+
[display]
58+
59+
window/size/width=1920
60+
window/size/height=1080
61+
window/size/fullscreen=true
62+
window/dpi/allow_hidpi=true
63+
window/stretch/mode="2d"
64+
65+
[editor_plugins]
66+
67+
enabled=PoolStringArray( )
68+
69+
[gui]
70+
71+
theme/use_hidpi=true
72+
73+
[input]
74+
75+
ui_accept={
76+
"deadzone": 0.5,
77+
"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":16777221,"unicode":0,"echo":false,"script":null)
78+
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777222,"unicode":0,"echo":false,"script":null)
79+
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null)
80+
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
81+
]
82+
}
83+
ui_left={
84+
"deadzone": 0.5,
85+
"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)
86+
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
87+
]
88+
}
89+
ui_right={
90+
"deadzone": 0.5,
91+
"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)
92+
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null)
93+
]
94+
}
95+
ui_up={
96+
"deadzone": 0.5,
97+
"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":16777232,"unicode":0,"echo":false,"script":null)
98+
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null)
99+
]
100+
}
101+
ui_down={
102+
"deadzone": 0.5,
103+
"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":16777234,"unicode":0,"echo":false,"script":null)
104+
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null)
105+
]
106+
}
107+
swap={
108+
"deadzone": 0.5,
109+
"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)
110+
]
111+
}
112+
no_swap={
113+
"deadzone": 0.5,
114+
"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)
115+
]
116+
}
19117

20118
[rendering]
21119

22120
quality/driver/driver_name="GLES2"
23121
vram_compression/import_etc=true
24122
vram_compression/import_etc2=false
123+
environment/default_clear_color=Color( 0, 0, 0, 1 )

0 commit comments

Comments
 (0)