The task for tonight is to create a clone of Tetris. This page lays out some of the decisions and tasks.
This is an aid to coordinating as a remote team.
You will need to decide on a 2D game framework. Some candidates are:
I would not recommend these for this project:
- Pygame - you will have to write a game loop and event handling yourself before beginning.
- Pyglet - being lower-level to OpenGL, this does not have a simple API for polygon/rectangle drawing, only sprites and text.
The following tasks are split up according to a "Model-View-Controller" pattern to make it easier to visualise the dependencies between the tasks, but this is not the only way (and may not be the best way) to write the game.
- Describe the seven tetronimo pieces (as described here).
- Generate a random piece. Show the next piece that will be generated.
- Rotate a tetronimo. This requires a centre of rotation for each tetronimo. See here for a description of this in the official games.
- Model the grid of filled cells.
- Allow testing whether a tetronimo intersects filled cells at a given position.
- Write a tetronimo into the filled cells.
- Remove each line that is filled and collapse lines above.
- Keep score.
- Create a game window.
- Draw the boundary of the play area.
- Draw the filled cells.
- Draw the active tetronimo.
- Draw the next tetronimo to drop.
- Animate the removal of a line.
- Show the score.
- Allow drawing "game over" over the screen.
- At the start of the game, make the next tetronimo the active tetronimo.
- Drop one step every t seconds. If the tetronimo cannot occupy the space below it, write it into the filled cells. Trigger an animation if a line is filled. Then make the next tetronimo active.
- Add keys for left/right. These do nothing if there is no space for the tetronimo.
- Add keys for rotate clockwise/anticlockwise. These do nothing if there is no space for the rotated tetronimo. At the walls, tetronimos may be moved outwards to accomodate the rotation.
- If there is no room to introduce the active piece, show game over.
- On the game over screen, press a key to restart.
- Implement the "drop all the way" operation.
- Describe requirements in a requirements.txt
- Write a README.
- Animate the rotation of the pieces.
- Animate the drop operation(s).
- Make the game speed increase very slowly (logarithmically?)
- Add juice - screen shake, trails, particles, sound effects.
- Add a title screen.
- Publish to PyPI.