;; 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) :keypressed (proto.meta-method-opt :state.keypressed) :mousepressed (proto.meta-method-opt :state.mousepressed) }