"Everything should be made as simple as possible, but not simpler."
Introduction
There must be a gazillion Tetris clones out there... Why another one?. Because I couldn't find a clone like this with a liberal open source license and programmed with code legibility in mind.
Objectives
This Tetris clone must be simple. At the same time it must be easy to tweak if you want to use your own rendering or input layers. If possible the core functions must be easy to port to another languages. Finally it must serve as an educational reference for novice game programmers. The good thing about Tetris is that it has a very well known gameplay mechanic and it is relatively simple to program but challenging enough for not being trivial.
Features
The core logic is programmed in simple ANSI C. The trunk implementation uses SDL as its graphic and input layer, however the idea is to make the game run with other platforms or languages (AS3, J2ME, openGL, DirectX, etc). This is the reason that the core logic is separated from the layers in charge to present the game to the user. Those layers are responsible of drawing sprites on screen, handling input devices, returning timer values, or even playing sounds and music. The core gameplay code or algorithms must run unchanged.
This is the list of expected features I'm aiming:
- A simple Tetris experience. The user must easily recognize the game and spent some time with it.
- No global neither static variables in the core game implementation, this must enable the game to run in ROM.
- Full separation between the core gameplay implementation and the graphic, input, sound, or font libraries than could be used by the game.
- Good code standards and formating.
The ambition of this little project is to become the default implementation whenever you need a simple Tetris clone and don't want to rewrite your own from zero.
Limitations
Because the trunk for this project must be simple some limitations are imposed:
- No Wall Kick
- No Ghost Piece
- No Delayed Auto Shift
- No Game Menu Screens
- No Effects
- No Sound
Branches are encouraged to implement the missing parts or create gameplay variations.
References
The gameplay mechanics reference can be found here: http://www.tetrisconcept.com/wiki/index.php/Main_Page
The original Tetris that can be found here: http://vadim.oversigma.com/Tetris.htm