Created
December 13, 2012 23:52
-
-
Save jellybob/4281222 to your computer and use it in GitHub Desktop.
Revisions
-
jellybob created this gist
Dec 13, 2012 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ (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 hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ (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)))) This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ (ns media-mogul.frontend.main-menu [ :use [ media-mogul.frontend [ callbacks :only [ updater renderer ] ] ] ]) (defmethod updater :main-menu [ state container delta ] (.setTitle container "Main menu")) (defmethod renderer :main-menu [ state container graphics ] (.drawString graphics "Hello, world!" 30 30))