Tetris

Difficulty: Medium

ABOUT

The game Tetris is a great game to make in Java since it is object-oriented. My goal for this project was to make it in about two days. I wanted to add more features to the game such as a guide to help the users play the game and a High Scores list. There is multiple ways to implement and I chose a way similar to the Scrolling Marquee Java project I helped developed with a team.

Diagram

How this game works is that there is a double array of integers. This is initialized with the width and height of the game board and filled with 0's. The 0's represent empty spots and any number that is greater than 0 represents a certain colored of Tetris block. For each digit I display a Tetris block from the image 0-7 and I split it according to the value of the position in the array. In the array to the right, I  would render the "4" values as green because it is the fifth position of this image. I split this image up in 8 different positions and the first position is transparent.  

More Projects You May Like

Quadratic Calculator Program

A program I wrote in the 8th grade to solve my own math homework. Study from it and build your own math problem solver.

Scrolling Marquee Project

Enter custom messages and watch them scroll across the screen like the signs that appear off of highways!

Parallel Parking Robot

Build a robot that is capable of finding a large enough gap to park in automatically.

Brick Breaker

Play Brick Breaker in Java! A classic game with some unique twists!