Created
December 13, 2012 23:52
-
-
Save jellybob/4281222 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns media-mogul.frontend.callbacks) | |
(defmulti renderer (fn [ state container graphics ] (:view state) )) | |
(defmethod renderer :default | |
[ state container graphics ] | |
(doto graphics | |
(.drawString "Using default renderer", 30, 30))) | |
(defmulti updater (fn [ state container delta ] (:view state) )) | |
(defmethod updater :default | |
[ state container delta ]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def state | |
ref { :view :main-menu }) | |
(def application-proxy | |
(proxy [ BasicGame ] [ "Media Mogul" ] | |
(init [ container ]) | |
(render [ container graphics ] | |
(renderer @state container graphics)) | |
(update [ container delta ] | |
(updater @state container delta)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment