Fixed an issue with lua context manager, tested to make sure it worked, started a document for the algorithm lua structure, updated engine loop

This commit is contained in:
2021-12-12 23:36:13 -05:00
parent 8213dd8cb3
commit 00abbbebbd
7 changed files with 56 additions and 2 deletions

14
documents/algorithms.txt Normal file
View File

@@ -0,0 +1,14 @@
Dungeon generation algorithms are written in lua and dropped into scripting->algorithms. They are automatically parsed by the visualizer and assigned keys in the program to run them.
Algorithms are made up of a single lua file (possibly more with requires) with the following functions:
initialize()
Initializes the algorithm and returns a structure/table with the following fields:
{
updates_per_second: int // Number of times the algorithm's update function should be called per second. Minimum of 1, converted into frames per update with a minimum of 1.
free_data: table // Free table that the developer can store necessary state data in
}
update(state)
The following functions are available to algorithms in either their update or initialize functions: