Programming and Probability - Tetris Attack
As the title suggests, the main objective of this project was to introduce the logic behind programming and the math behind probability. To do this, we were told to pick a video game with a randomness element. We were then given tutorials and lessons about programming and probability leading up to the final product: a miniature recreation of our chosen game. In addition, we would think of a question involving the game’s randomness element and answer it with the exact theoretical probability. The game I chose to recreate was Tetris Attack. My project can be found and played here. (Understand that the game is not complete, therefor it doesn't successfully play like the original.)
There were five main benchmark points in this project.
|
As I mentioned earlier, the game I decided to recreate was Tetris attack. You can play an online version of the official game here. (To get to the actual game screen, click any button, use the z button to select "1 Player Game," then select "Endless," Next, use the z button to chose speed level one, easy game level, and any avatar.) To play the game, you move the cursor (with the arrow keys) over the colored blocks and switch them around (with z or x). You match the blocks horizontally and vertically in sets of three or more to get them to disappear. The player is rewarded for matching more than three at a time, as well as getting blocks to fall into combos. The goal of the game is to play for as long as you can before all the blocks reach the top of the screen. I love playing this game, so I decided to make my own version. I was able to program the terrain creation, block creation, and player functionality. Unfortunately, I was never able to get the switching or disappearing elements to work properly. The important thing to remember is the random element of the game. The blocks that continually appear at the bottom of the screen are set to change their color to one of six choices, red, orange, yellow, green, blue, or purple. This means that a block has a one in six chance of picking any of those given colors. I was able to program this accurately.
This project was my first experiences with both programming and probability. Taking that fact into account, I think I have a lot to be proud of. I am able to answer complex probability questions using numbers, two way tables, and visualization. I am also able to understand and write up intermediate level code. I don’t overlook the fact that I didn’t finish my game. I was two game mechanics away from having a finished game. I had to program the matching blocks to disappear, and I had to program the block switching player action. I knew exactly what had to be done, but I had never coded before. I didn’t know how to construct those commands, so I was unable to get it done. This issue might’ve been remedied by working with a partner. That way I could've gotten some more advanced experience. All that being said, I’m still proud of my game, and I’m still proud of what I’ve learned throughout the course of this project.