Created
December 15, 2014 16:45
-
-
Save gazliddon/298480b62c80f42593e3 to your computer and use it in GitHub Desktop.
Man, clojure is terse
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 get-event-action [table event current-state] | |
(let [identity (fn [o _] o)] | |
(get-in table [current-state event] identity))) | |
(def player-state-table | |
{:spawning {:timeout go-running } | |
:running {:button go-jump | |
:fall-off go-fall } | |
:falling {:out-of-bounds go-die | |
:button go-jump | |
:landed go-running } | |
:jumping {:button go-double-jump } | |
:dieing {:timeout go-quit}}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment