From 0c8a8cf8d861bc4ef3162e45e8b58d2f0173d2f7 Mon Sep 17 00:00:00 2001 From: equa Date: Sun, 18 Apr 2021 09:57:30 -0500 Subject: nanpa wan commit of the last two days: working cellular automata and rendering, prototype system, etc --- lib/state.fnl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 lib/state.fnl (limited to 'lib/state.fnl') 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) + } -- cgit 1.3.0-6-gf8a5