diff options
author | equa <equaa@protonmail.com> | 2021-04-18 09:57:30 -0500 |
---|---|---|
committer | equa <equaa@protonmail.com> | 2021-04-18 09:57:30 -0500 |
commit | 0c8a8cf8d861bc4ef3162e45e8b58d2f0173d2f7 (patch) | |
tree | 5fe4e826b92173f33abf8a1f2391ccab706db230 /lib/state.fnl |
nanpa wan
commit of the last two days: working cellular automata and rendering, prototype system, etc
Diffstat (limited to 'lib/state.fnl')
-rw-r--r-- | lib/state.fnl | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/state.fnl b/lib/state.fnl new file mode 100644 index 0000000..d98b94e --- /dev/null +++ b/lib/state.fnl @@ -0,0 +1,19 @@ +;; later if it becomes a hassle we can convert this into a separate +;; file that we can reload or something + +(local proto (require :lib.proto)) + +{ + :init (proto.table-method :state.init) + ;; update is a bit special; it can either return nothing (the state continues + ;; as is, and mutated somehow (sorry we're doing things non-purely; i'd like + ;; to do them purely but creating tables is slow as heck that'd be ridiculous)) + ;; or it can return a state that it transitions to automatically + ;; game pausing basically works like that: it returns a pause structure with the + ;; regular state within its object, and then the pause structure uses that state + ;; object to return back to it later. pretty cool! + :update (proto.meta-method-opt :state.update) + ;; all of the next functions are just. regular love functions, exactly the same + ;; i hope + :draw (proto.meta-method-opt :state.draw) + } |