beef331 / website

Code for the official Nim programming language website
https://nim-lang.org
19 stars 1 forks source link

nim-tilengine #62

Closed exelotl closed 1 year ago

exelotl commented 1 year ago

Name: nim-tilengine

Author: exelotl

Posting:

nim-tilengine is a set of bindings for Tilengine, a free, cross-platform 2D rendering engine for creating retro-style games using tilemaps, sprites and palettes. Many oldschool tricks are supported such as palette-based animation and per-scanline raster effects. Rendering is all done in software. The implementation is efficient and can run well even on a Raspberry Pi.

The Nim bindings strip away all the cruft from the C API, becoming shorter and more readable than even the official Python bindings, while keeping native performance!

Example:

Screenshot of a cave level from Goodboy Galaxy running in an SDL window.
import tilengine

let engine = init(320, 180, numLayers = 4, numSprites = 128, numAnimations = 128)

let map = loadTilemap("assets/map.tmx")
Layer(0).setTilemap(map)

createWindow()
while processWindow():
  drawFrame()

map.delete()
deleteWindow()
deinit()
beef331 commented 1 year ago

Added to October.