Tofu Engine

~ a 2D game engine w/ an eco-friendly pixel-art retro-soul ~

v0.12.0

Project Structure

As hinted in the Getting Started page, each #tofuengine project is expected to have a well-defined structure to be successfully recognized. That is, some files need to be located in the project’s root folder and have a predefined specific name in order for things to work, that is

Let’s see in more detail the content of those files.

Configuration File

The tofu.config file is used to configure the general behaviour of a game project. The file structure carries some resemblance with .ini files in that each line can be either:

A key/value pair get its proper meaning according to the section where it appears. There’s no predefined and required order for the configuration options to appear in the file, but take care in locating each key/value pair in its proper section. A section can appear multiple times in the same file, i.e. the configuration parameter context can be switched multiple times, if wanted. If a property appears multiple times, the last occurrence will define the actual value. Also, whitespace are significant, so bear this in mind when editing the configuration file.

A typical (complete) configuration file is the following:

[system]
identity=
version=0.10.0
debug=true
icon=icon.png
mappings=gamecontrollerdb.txt
[display]
title=.: Tofu Engine :.
width=320
height=240
scale=0
fullscreen=false
vertical-sync=false
effect=effect.glsl
[audio]
device-index=-1
master-volume=1.0
[keyboard]
enabled=true
exit-key=true
[cursor]
enabled=true
hide=true
speed=128.0
[gamepad]
enabled=true
sensitivity=0.5
inner-deadzone=0.25
outer-deadzone=0.0
emulate-dpad=true
emulate-cursor=true
[engine]
frames-per-seconds=60
skippable-frames=3
frames-limit=0

Sections

system

display

audio

keyboard

cursor

gamepad

engine

Entry-point

Fragment shaders