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:
14
documents/algorithms.txt
Normal file
14
documents/algorithms.txt
Normal 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:
|
||||
|
||||
Reference in New Issue
Block a user