Giter Site home page Giter Site logo

blocks's Introduction

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 some of the implemented branches:

  • Unreal Engine port for Unreal Engine 4.27 using C++ (no Blueprints for gameplay)

    unreal4

  • TypeScript using HTML5 canvas. You can play it here.

  • Killa for cocos2d-x with Killa support

  • Lua for Love 2d

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

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

  • J2ME for cellphones with CLDC 1.1 and MIDP 2.0.

J2ME ancient pic of my missing phone

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

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

blocks's People

Contributors

ex avatar vectorsatyr avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.