Currently incomplete and in development Forest2D is a 2d tile-based cross platform game engine written primarily in Lua using the Lua-SDL2 binding.

tomlukeywood 55b4592ad6 Update 'HowToCompileDebian.txt' 4 years ago
Assets 991ef36547 added functions to load and save the sprite list. 5 years ago
Data 39722fb30c minor fixes 5 years ago
Libs a19f1aaefa minor update added paths lib 5 years ago
src d381020f15 minor fixes 5 years ago
COPYING 03be90ad80 initial commit 6 years ago
Forest2D.geany 39722fb30c minor fixes 5 years ago
HowToCompileDebian.txt 55b4592ad6 Update 'HowToCompileDebian.txt' 4 years ago
Manual.adoc 39722fb30c minor fixes 5 years ago
README.adoc 07a1d7e8e6 minor changes 5 years ago

README.adoc

= Forest2D
A 2d tile-based cross platform game engine
written primarily in Lua using the Lua-SDL2 binding.

It is intended for simple 2d tile-based games providing
graphics, audio, collision detection, sprites,
tilemaps, gui, animation and more. +
Forest2D depends greatly on Lua-SDL2 and the entire API can be called after initialization:
[source,lua]
local Forest2D = require "Forest2D"
Forest2D:Init()

== Dependences

* *Lua* (5.2 or 5.3), required
* *Lua-SDL2*, required
* The lua *paths* module, required
* *C* compiler, required
* *GNU Make*, for building

== Building

Install all dependences and compile with

[source,sh]
----
cd Forest2D
make
----

== Usage

you can call and use the Forest2D.lua file like so
[source,lua]
----
local Forest2D = require "Forest2D"
Forest2D:Init()
Forest2D.WINDOW_WIDTH = 640
Forest2D.WINDOW_HEIGHT = 480
window = Forest2D:CreateSDLWindow("mywindow", "icon.bmp")
local Renderer = Forest2D:CreateSDLRenderer(window)
local EventHandler = Forest2D.EventHandler.New(2) --2 milisecond delay between events

--main loop
while true do
EventHandler.GetActiveEvents()
if EventHandler.EventStatus[EVENT_SDLQUIT].Active
or EventHandler.EventStatus[EVENT_ESCKEY_PRESSED].Active
then goto QUIT end

--game code

Renderer:present()
Renderer:clear()
end

::QUIT::
Forest2D:Quit()
----

== Notes

Currently a file called Pixel.bmp must be present in the same directory as the Forest2D program for GUI functionality to work.
If you do not have this file just create a 1x1 white bitmap image called Pixel.bmp for this purpose.

== Documentation

See Manual.adoc for more information.