summaryrefslogtreecommitdiff
path: root/honey/notes.md
blob: 5dd25e7173655ad4b039bcea1efd1d304482f9ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
avoid closures where possible; they lead to weird garbage collector effects!


assets
------

assets are cached. each asset type has a module (e.g. `mesh`, `image`, `sound`, etc). These have the following functions:

	* `get(filename)` - cached load of the given file. throws error if it cannot be found
	* `forget(filename` - remove the cached copy, if any of the given file
	* `clearCache()` - clear the full cache for that asset type

individual assets may have additional functions.


systems
-------

systems are pure functions (NOT closures!!). they can be embedded in tables that indicate dependencies, i.e. which other systems *must* execute before them in order for things to work correctly. They have a signature like

> `system(db, dt, [params])`

where params is a table. all parameters, including the params table, are passed in by the systemdb every frame; the system should NEVER close over them.