From 3275ae4948fd2c1bb8da780214cbb741dc3178be Mon Sep 17 00:00:00 2001 From: sanine Date: Fri, 12 May 2023 01:16:46 -0500 Subject: begin refactor --- honey/notes.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 honey/notes.md (limited to 'honey/notes.md') 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. -- cgit v1.2.1