SheatNoisette / potetre2d

A tiny engine for small games
GNU Lesser General Public License v3.0
3 stars 1 forks source link
c-language game-engine wren wren-language

Potetre2d

L'as tu faite? Potetre

A really small (in size) game engine for 2D games, made originally for the 4Mb Game Jam. We were disappointed by the lack of 2D game engine that could fit in 4Mb, so we made one. The objective of this project is to make a Löve2D like engine, but with a smaller footprint. We didn't wanted to write bare C code, so any game written with this engine are written in Wren.

Features:

Quick example of the API:

var WIDTH = 320
var HEIGHT = 240
var TITLE = "Random screen"

class Game {
    /* Called when the game is started */
    static init(args) {
        System.print("Picogine Init!")
        Engine.init(WIDTH, HEIGHT, TITLE)
    }

    /* Called every frame if Engine the engine is initialized */
    static tick(dt) {
        if (Input.is_key_pressed(Keycodes.ESCAPE)) {
            Engine.destroy()
        } else {
            // Random pixel
            for (x in 0..WIDTH) {
                for (y in 0..HEIGHT) {
                    Draw.put_pixel(x, y,
                        Random.rand() * 255,
                        Random.rand() * 255,
                        Random.rand() * 255
                    )
                }
            }
        }
    }
}

Building

See Building.md for instructions on how to build the project.

Documentation

See the doc/ folder for documentation. A getting started guide is available here.

License

This project is licensed under the LGPLv3-only License - see the LICENSE file for details.

Only exception are examples (in the examples/ folder) which are public domain.