Overview of game idea
For the final project, Ngoc and I plan on implementing a slightly modified version of the game “Tetris” by using both Arduino and Processing. The rules of the game are pretty simple. Blocks of different colors fall down the screen and stack on top of each other. The user controls the movement of the blocks (by gesturing in front of two different sensors in our version of the game), and the game speed increases by a certain value as blocks continue to drop. When the player manages to get 4 blocks of the same color in a sequence, the game speed is reset to the original value and the score increases by 1. The game ends when the entire screen is filled with blocks.
For the Processing part of the game, we plan on having two main classes, the block class and the game class.
- Block Class: The block class will describe all the attributes of the blocks which continue to fall on the game screen. It will include methods which specify the limitations on the movement of the blocks, i.e. the block can not move out of the screen, the block can not cross another block, and that the block has to “sit” on top of another block if one is found directly below it.
- Game Class: The game class will contain all the main features of the game. These include instantiating a new block to fall every time the previous block has stopped moving (i.e. settled at the last row or settled on top of another block). The game class will also check if blocks of the same color are found together in a sequence, then it will remove those blocks from the game screen and increment the score of the player. Moreover, it will control the number of lives a player has and what the game should do when the player uses a life. It will also control when the game ends.
For the hardware, we plan on using a number of different components corresponding to different game functions.
- Buttons: we plan to have a few buttons for fundamental game control, for example starting a new game
- Potentiometer: when presented with the options of levels at the beginning of the game, the player can use the potentiometer to traverse through the options and select a specific level
- Photo resistor: the player can choose to spend one life by tapping on the photo resistor
- LEDs: we plan to light up LEDs to signify the number of lives available to the player, and turning off one LED for each life spent
- Ultrasonic sensors/distance measuring sensors: we plan to use two distance measuring sensors installed on two sides for the main game action. The initial concept is that the player can gesture in front of one of the two sensors to communicate which side to direct the block (i.e. tapping on the right moves the block one step to the right and vice versa)