I created the GUI for a working Tetris game. I used back end code provided by my Java instructor, and displayed the Tetris components onto a panel. I scanned through arrays and painted the colors found in them to the appropriate x and y coordinates of a panel. I added a Swing Timer to update the game by utilizing the Observer Design Pattern, and attached key Listeners to the GUI to listen for when the Tetris pieces should be moved. I also added various functions to the game like the ability to pause, end, and start a new game. Lastly, I gave the user the ability to re-size the GUI in three different ways, as well as provided a pop up window which allowed the user to customize the controls of the game.
Below is the link to download my Tetris game. Right-click and “save target as”.
If you want to see my coding style, right click and download the zip file below which contains all of my classes. Once again the “view” is my own original code, and the “model” was supplied by my instructor.