3 ms·
Here's an Asteroids clone I wrote in Clojure a few years back, which has less than 400 lines and some neat stuff like procedurally generated 3D asteroids: https
by prospero 14y ago
Here's an Asteroids clone I wrote in Clojure a few years back, which has less than 400 lines and some neat stuff like procedurally generated 3D asteroids: https://github.com/ztellman/penumbra/blob/master/test/example/game/asteroids.clj https://github.com/ztellman/penumbra/blob/master/test/exampl...
Some of the design decisions are discussed in detail at http://ideolalia.com/creating-a-simple-game-in-clojure http://ideolalia.com/creating-a-simple-game-in-clojure
- fusiongyro 14y agoThe Lisp code used multiple dispatch to handle collisions between objects, whereas your Clojure code instead uses list comprehensions to generate pairs of colliding objects by type. I know Clojure also supports multiple dispatch, so I'm wondering if you could comment on this design decision.
- prospero 14y agoThe only collisions I care about in my implementation are asteroid/ship and bullet/asteroid, and they're easier to express directly. The OP's version appears to have many more types of collisions, which makes multiple dispatch a more obvious choice.
- slig 14y agoThanks for the blog post. Very informative and concise.
- nemoniac 14y agoCould you update the penumbra README? I'd like to try it out but the instructions are outdated.
- prospero 14y agoOutdated how? They were working the last time I made a commit a year ago, I'm not sure what could have changed.