Skip to content
jdp edited this page Sep 12, 2010 · 14 revisions

Tarn is a minimalistic Lua-scriptable roguelike engine written in C, using the Doryen Library as its I/O interface.

Building

You’ll need Lua 5.1 and the Doryen Library 1.2.1 to build Tarn, as well as a halfway decent C compiler. You might have to mess with the makefile a bit to make it work, I’m sure not everyone keeps their pathnames the same as I do.

Using

As it stands, Tarn is a very simple system. When you run it, it will first load the script that is defined in tarn.h as START_SCRIPT. By default, it is tarn.lua. You are then able to access the Tarn API through Lua. At the moment, the API is small and is comprised of the following Lua functions:

tarn_init Initializes the Tarn API
tarn_loadmodule Loads a Tarn module from the modules/ directory
tarn_dofile Executes a Lua script in the Tarn Lua state
tarn_print Prints a string at a specified position. Can also handle control codes
tarn_getkey Waits for a keypress and returns a table describing it
tarn_draw Redraws the Tarn screen
tarn_clear Clears the Tarn screen

Tarn also has a few special built-in variables.

Modules

Tarn now comes with a few small and useful modules. They are in no way necessary, and they are only there for your convenience. They are located in the modules/ directory, and can be loaded with tarn_loadmodule. Documentation coming soon.

Getting Started

Making games with Tarn is supposed to be painless. Here is a guide to getting started.

Clone this wiki locally