The inspiration for the game is from the classic game _ Simon _. The computer gives a sequence based on the 4 colour buttons. The user has to repeat the sequence, and if correct, the sequence gets harder.
What it does
Similar to _ Simon _, the computer will give out a sequence denoted by buttons. The number of buttons increases as the levels go on, but players have 3 lives. Each button is characterized by a Massey student and their catchphrase. The button glows when it is being played and runs for around a second. If players successfully repeat the sequence, they move on to the next level, where the sequence gets harder.
How we built it
massey says... has 2 main classes: one that handles the menu including displaying the different panels (called MasseySays), and one that handles the game itself (called GamePanel). Both the MasseySays class and the GamePanel class implement ActionListener to deal with events. At the beginning, an intro screen is displayed with a play button, instructions button, high scores button, and credits button. The menu is displayed using a JPanel with a card layout, and every time an event is called from clicking a button on the intro screen, the "card" shown on the JPanel is changed, displaying a different screen, e.g. clicking the high scores button will lead the users to the high score screen. There is also a timer which fires an event to the ActionListener every 10 milliseconds, at which the GamePanel updates itself. In the GamePanel, an array of buttons is made along with a corresponding array of sounds. The user's initial stats are set (e.g. number of lives is 3). At the beginning of each level, buttons are randomly chosen from the array of buttons, with no repeats, to be put into an ArrayList of buttons that will be used that level. The number of buttons chosen corresponds to the level number. From this ArrayList, the sequence is chosen by randomly selecting buttons from the ArrayList, this time with repeats allowed. This sequence is put into an ArrayList. The sequence is shown by adding an orange outline over the buttons in the proper order in one-second intervals. Afterwards, the user is allowed to click which buttons he/she believes is the correct order. If the button he/she clicks is correct, his/her score increases. If it is wrong, a life is lost. If the user has no lives left and loses again, the game over screen appears, prompting them to restart or go back to the menu (home). If the user got a high score, a dialogue box pops up that allows him/her to enter his/her name in and added to the high score list. If no name is given, the default is "Unknown". The high scores with the players' names is stored in a txt file. When the MasseySays class is initialized, the txt file is read to get the current high scores.
Challenges we ran into
One of the biggest challenges was related to the sound editing. Since the sound is played when a player clicks the button, the sound byte needs to be short enough to be heard between clicking the buttons, but long enough to be considered a sound. Due to lengths of the recorded catchphrases, some phrases will be cut off if players repeat the sequence quickly.
What's next for massey says...
Nothing for now. We may add more levels or buttons, but it's just a simple game for enjoyment.