Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/null93/tetris
Tetris game clone for CS342 at the University of Illinois at Chicago
https://github.com/null93/tetris
game-clone java-game maven tetris
Last synced: 10 days ago
JSON representation
Tetris game clone for CS342 at the University of Illinois at Chicago
- Host: GitHub
- URL: https://github.com/null93/tetris
- Owner: null93
- Created: 2016-04-14T22:25:04.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-04-30T03:53:30.000Z (over 5 years ago)
- Last Synced: 2024-11-08T12:51:05.249Z (2 months ago)
- Topics: game-clone, java-game, maven, tetris
- Language: Java
- Homepage:
- Size: 20.2 MB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tetris
> Tetris game clone for CS342 at the University of Illinois at Chicago![MIT License](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)
![Version 1.0.0](https://img.shields.io/badge/Version-1.0.0-yellow.svg?style=for-the-badge)
## About
The two design patterns used in this project are **Factory** and **Singleton**. **Factory** pattern occurs in Tetromino ([Tetromino.java](src/main/java/com/tetris/Tetromino.java)) and all the Sub TetrominoX classes. We implemented our tetrominoes such that the parent _Tetromino_ class deals with all the movements and the modifications we make to the tetrominoes and the subclasses just deal with creating a tetromino with a specific spawning coordinates. **Singleton** pattern occurs in the _Shadow_ class ([Shadow.java](src/main/java/com/tetris/Shadow.java)). This class, whose job is to spawn a shadow of the current piece, is implemented in such a way that an instance of shadow can not be made and has static methods.
## Building & Running & Cleaning
This project uses Maven as it's build system. If you would like to build and run the application from source, then the following commands will prove useful.
#### Compile Classes & Package JAR
```shell
mvn package
```#### Run Main Class From JAR
```shell
java -cp target/tetris-1.0.0.jar com.tetris.Tetris
```Once the program launches, you can play the game using the on-screen buttons. Alternatively, open **Information > Help** to get playing instructions and keyboard shortcuts.
#### Clean Generated Files
```shell
mvn clean
```> **Note**: This will not delete the var folder that contains your highscores.