Tilengine is a free, open source cross-platform 2D graphics engine for creating classic/retro games with tilemaps, sprites and palettes. Its scanline-based rendering system makes raster effects a core feature, the same used on actual 2D graphics chips.

Clone on GitHub Download itch.io

Main features

Open source

Tilengine is released under the LGPL license, making it free for any project even commercial ones


Tilengine is written in portable C99, without dependencies on any OS or third-party proprietary component.

Multiple languages

Beside its native C API, there are full bindings for many high-level languages like C#, Python, Java, Pascal...

High performance

Tilengine is high-speed native code. All samples run at 60 fps with CRT emulation enabled on a Raspberry Pi 3.


Tilengine can be easily embedded inside other game engines as a slave renderer on an user-provided video surface.


Tilengine has a very lean API, designed to be easy to learn but yet get impressive results with very little lines of code.

Graphical features

Raster effects

Modify rendering parameters for each scanline. This technique is used to generate visual effects


Scale sprites, rotate and scale any layer. Like combining SNES Mode-7 with Sega SuperScaler!


Several types of blending available for mixing, lighting or shadow effects for layers and sprites.

Animation engine

Animate sprites, tilesets and complex color cycles with Tilengine's built-in sequencer.

Visual effects

Many built-in retro effects: mosaic for SNES-like pixelation, per-column tile offset, CRT emulation...

Collision detection

Pixel accurate collision detection between sprites vs sprites and sprites vs tilemap background

Basic example

The following snippets illustrate how easy is to use tilengine in your program. Both snippets are equivalent, one in C and the other in Python. They initialize the engine at 400x240 resolution, with one background layer, no sprites and 20 animation slots. Then loads a map in Tiled TMX format, attaches it to the layer, and finally creates a display window and does a main loop until the user closes the window.

C language

#include "Tilengine.h"

void main(void){
    TLN_Tilemap foreground;

    TLN_Init (400,240,1,0,20);
    TLN_SetLoadPath ("../assets/sonic");
    foreground = TLN_LoadTilemap ("sonic_md_fg1.tmx", NULL);
    TLN_SetLayer (0, NULL, foreground);

    int frame = 0;
    TLN_CreateWindow (NULL, 0);
    while (TLN_ProcessWindow()){
        TLN_DrawFrame (frame);
        frame += 1;
    TLN_Deinit ();

Python language

import tilengine as tln

engine = tln.Engine.create(400, 240, 1, 0, 20)
foreground = tln.Tilemap.fromfile("sonic_md_fg1.tmx")

window = tln.Window.create()
while window.process():

Made with Tilengine


Thunder Force IV

Mode 7 distortion


For more samples, please visit Tilengine youtube channel