Difficulty: Medium



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.


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

Parallel Parking Robot

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

Rock Paper Scissors Game

Create a fun and interactive rock, paper, scissors game that can play against the computer or another player.

Brick Breaker

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

Fireworks Screensaver

An animated screensaver that displays pixel fireworks. It also gives details on how many have been launched since opened. Set it as your background!