-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathREADME
More file actions
115 lines (106 loc) · 5.11 KB
/
README
File metadata and controls
115 lines (106 loc) · 5.11 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
ΩHero (Arduino)
CMPUT 274 Assignment 3 (Final Project)
DESCRIPTION
This game is modeled based off of GUITAR HERO and TAP TAP REVENGE
Currently features 7 amazing songs!! We recommend: Chinese and Song in C Major.
Don't miss any notes, since you will lose lives.
Features: randomly generated play and music! (it still sounds great though, except for dissonance in no particular key)
TO RUN THE CODE
Unzip the folder
Open terminal to the unzipped directory
Type "make" into the terminal
Connect your Arduino Mega 2560 to the virtual machine, wired as below
Type "make upload; serial-mon" into the terminal to upload the code to the Arduino
ACCESSORIES
1x Arduino Mega 2560
1x Adafruit_ILI9341 Touchscreen
1x Piezo Buzzer
Assorted wires
WIRING INSTRUCTIONS
Adafruit_ILI9341 Screen [pin from screen -> pin to Arduino]:
GND -> GND
Vin -> 5V
3Vo NOT CONNECTED
CLK -> 52
MISO -> 50
MOSI -> 51
CS -> 10
D/C -> 9
RST NOT CONNECTED
Lite NOT CONNECTED
Y+ -> A2 (analog pin)
X+ -> 4 (digital pin)
Y- -> 5 (digital pin)
X- -> A3 (analog pin)
IM0 NOT CONNECTED
IM1 NOT CONNECTED
IM2 NOT CONNECTED
IM3 NOT CONNECTED
CCS -> 6
CD NOT CONNECTED
Piezo Buzzer [Choice of Lead1 and Lead2 of the buzzer is arbitrary]:
47 (Arduino) -> Lead1 (buzzer) -> |Piezo Buzzer| -> Lead2 (buzzer) -> 5V (Arduino)
FILE STRUCTURE
screenLogic.cpp is the main file which contains the functions for the game as
a whole as well as the imports from other files
menus.cpp handles drawing, updating and interacting with the menu system
sorting.cpp handles the sorting of the song list using Quicksort
menus.h / sorting.h are the header files for the above two files, respectively
song.h is the structure for the storage of song metadata
GAME INSTRUCTIONS
- Most information is obvious through on screen instructions
- The Back button always sends you to the previous screen or exits a submenu
- The scroll arrows on the right of the screen become active if there is more
information off screen in that direction. Press them to scroll up or down
- In the Difficulty Select screen, Easy Mode sets your starting lives to 5 and
Hard Mode sets your starting lives to 1
- In the Song Select screen you can select the song you wish to play to
begin the game
- The Sort submenu in Song Select lets you modify the order in which the songs
are displayed on in the list, based on the listed parameter
- Highscores are listed from song with the highest score to song with the
lowest (unless no scores are recorded, in which case it is alphabetical by title)
- In game tap the circles at the bottom of the screen as the "note" is passing
through it to score points. If you are incorrect with your timing you
will lose a life and not score a point.
- If you reach 0 lives you lose the game, and if your final score was higher
than the previous highest score for that song it will be saved as a new High Score!
HELP AND INFO
- The touch screen is oriented differently than it was in previous projects,
such that the top of the screen is the side furthest from the Arduino
- The touch screen can seem to be a bit inaccurate in the menus at times, but
that is because the actual main point of contact of your finger to the
screen is lower than you would expect
- The wiring is relatively straightforwards
- The serial monitor displays information of the execution of the code, such
as output from the sorting methods, however it is not used as an input
and is not required to play the game
- The game is played entirely through the touch screen, thus all menu navigation
and gameplay is handled there. It should be intuitive what each button
does, but the game instructions above are more explicit
- The length and difficulty of each song has no bearing on gameplay and are purely
for demonstrating the multiple options for sorting the list. The actual
difficulty of the game is controlled in the Difficulty Select menu.
- Each song corresponds to a different set of sounds with a semi-random sequence
of "notes" to hit, with each game ending when you run out of lives
- High Scores reset upon restarting the Arduino
- If adding new songs to the song list make sure to add the metadata to the
appropriate location of each array for the name, length (in seconds),
difficulty (1-3, 3 being the hardest), source game title, and composer / artist
- If you have added or removed any songs be sure to modify the numsongs
variable and the initial size of the songs array
- The order of the audio notes in the song is a set of preset arrays of frequencies
in the different keys which are chosen at random
- The order of the visual notes (that you tap in game) is based on a semi-random
array of preset values
NOTE
Implements code created by TAs and instructors of the course (from eClass)
Wiring instructions based on ones from eClass
Created by Amir Shukayev (1506343) and Navras Kamal (1505463)
December 2017
____ _ _
/ __ \ | | | |
| | | || |__| | ___ _ __ ___
| | | || __ |/ _ \ '__/ _ \
_\ \/ /_| | | | __/ | | (_) |
(___||___)_| |_|\___|_| \___/