Everything should be made as simple as possible, but no simpler.
Albert Einstein
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. There are other projects like this but many have GPL licenses that make troublesome their use in commercial projects or console development.
Objectives
This clone must be simple to understand and because that, easy to tweak (if you want to use it for your own projects). Changing rendering and input layers must be a breeze and even the core gameplay functions should be easy to port to another platforms or languages. Ultimately, 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 implement but challenging enough for not being trivial.
Features
The core logic is programmed in simple ANSI C. The core gameplay logic is separated from the layers in charge of presenting the game to the player. Those layers would be responsible for drawing sprites on screen, handling input devices, returning timer values, or even playing sounds and music, so the game must be platform agnostic. The trunk implementation uses the awesome cross-platform SDL library for graphics and input.
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.
- Full separation between the core gameplay implementation and the graphic, input, sound, or font libraries that could be used by the game.
- No global neither static variables in the core game implementation (because global things are bad things).
- Good code standards and formatting (because code is poetry).
The ambition of this little project is to become the default implementation whenever you need a simple clone and don't want to rewrite your own from zero.
Limitations
Because the trunk for this project must be simple (and I'm lazy) some limitations are imposed:
- No Wall Kick
- No Game Menu Screens
- No Effects
- No Sound
Branches are encouraged to implement the missing parts or even create gameplay variations.
Branches
This is the list of currently implemented and possible future branches:
- Flash AS3. You can test it here.
- Playground. This version nicely supports localization:
- J2ME
- Canvas
- Qt
- IPhone
- PIC
Maintainers
- Laurens Rodriguez Oscanoa
References
The gameplay mechanics reference can be found here: http://tetris.wikia.com/wiki/Gameplay_overview
The original Tetris that can be found here: http://vadim.oversigma.com/Tetris.htm