diff options
Diffstat (limited to 'honey/notes.md')
-rw-r--r-- | honey/notes.md | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/honey/notes.md b/honey/notes.md new file mode 100644 index 0000000..5dd25e7 --- /dev/null +++ b/honey/notes.md @@ -0,0 +1,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. |