Skip to content

ycaihua/simple-tetris-clone

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 many little projects like this but most of them have restrictive GPL licenses or are very difficult to read and change. This one is released under the permissive MIT license and hopefully it's easier to understand and modify.

alt text

Objectives

This clone must be easy to understand and because of 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 ANSI C and C++. The gameplay logic is separated from the layers in charge of presenting the game to the player. Those layers are 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 SDL library for graphics and input but another languages and platforms would be supported in the branches.

This is the list of expected features I'm aiming:

  1. A simple Tetris experience. The user must easily recognize the game and spent some time with it.
  2. Full separation between the core gameplay implementation and the graphic, input, or font libraries that could be used by the game.
  3. No global variables in the core game implementation.
  4. Good code standards.

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 menu screens
  • No effects

Branches could implement the missing parts or create gameplay variations.

Branches

This is the list of currently implemented and possible future branches:

alt text

alt text

alt text

alt text

  • Unity (programmed in C#). You can play it online here.

alt text

  • iPhone and iPod Touch (using OpenGL ES 1.1 and an Objective-C bridge between iOS and the C++ game logic object)

alt text

  • OpenGL for graphics cards that support OpenGL 1.1 (Windows)

  • J2ME for cellphones with CLDC 1.1 and MIDP 2.0.

alt text

  • AS3 This version doesn't need the Flash IDE to build only the Flex SDK. You can play it online here.

alt text

References

A reference of the gameplay mechanics can be found here: http://tetris.wikia.com/wiki/Gameplay_overview
The original Tetris can be found here: http://vadim.oversigma.com/Tetris.htm

alt text

Credits

  • Programming by Laurens Rodriguez

  • Music by Jarno Alanko

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published