-
-
Save verma/304538e144216453809a 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
(def level ["^------$" | |
"< >"]) | |
(def symbols | |
{ \^ '(0 0 64 64) | |
\- '(64 0 64 64) | |
\< '(0 64 64 64) | |
\> '(128 64 64 64) | |
\ '(64 64 64 64) | |
\$ '(128 0 64 64) }) | |
(defn game [state ctx] | |
(doseq [[line row] (map list level (iterate inc 0))] | |
(doseq [[c i] (map list line (iterate inc 0))] | |
(let [[sx sy sw sh] (get symbols c)] | |
(blit! ctx image sx sy sw sh (* 64 i) (* 64 row)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
An alternative: