A year has passed since the last post! Well, almost anyway. I was actually surprised to see that the last post was about 11 months ago – it felt more like 3. Just goes to show how busy I have been (or that I’m starting to get Alzheimer’s). Anyway, I’ve been intent on posting a clojure Project that I did as part of my universities “Designing Interactive Systems” course. Now that I have turned in my bachelor thesis just a few days ago, it is time to do just that.

So what is it all about you ask? Well, it is a game prototype. Written in ClojureScript from a forked ClojureScript One repository. I only really used the ClojureScript One Project because it allowed me to write ClojureScript code without worrying too much about how to set it all up. I’m not actually using any of the server↔client message passing functions that ClojureScript One provides.

The game itself is intended to be for children, which is why its very simple and colorful – or at least that was the intention. Since I am the one who made/chose the graphics, obviously its not going to be the best fit.

A first paper prototype that led to the software prototype can be looked at here.

In order to “beat” the game, you have to clean up the room. Some experimentation may be required as not everything gives actual visual and auditive feedback. Once you beat the game however, you’ll be rewarded with some stars and music. Unless you are using a browser that does not support playing ogg audio files (I’m looking at you IE & Safari!).

Pictures (of an earlier version, but still fairly accurate): http://justyouraveragehacker.files.wordpress.com/2012/06/wpid-blog_base_game_screen.png?w=791 http://justyouraveragehacker.files.wordpress.com/2012/06/wpid-blog_winning_screen.png?w=791

So without further ado, here it is, hosted as a heroku app: http://dis-ws2011-software-prototype.herokuapp.com/

Oh yeah, its all in german :-)

Depending on heroku start-up time and your connection speed, it may take a few minutes to load. The entire thing is about 5mb large and runs best in Google Chrome.

Since it has been created within a tight schedule of about one week, the source code may be somewhat ugly and I highly doubt useful for anyone. Still I’ve made it available on my github account.

All the animation work has been done with the excellent CAAT library (that is also being actively maintained and growing in features for quite some time now). I did wrap it in ClojureScript functions however, so it is possible to write something like:

(let [md 10]
  (animate!
   basket-head 
   [:move :up md :left 5 :time 200]
   [:move :to [0 0] :time 300]
   [:move :up md :left (- 5) :time 150]
   [:move :to [0 0] :time 300]
   [:move :up (/ md 2) :left 5 :time 200]
   [:move :to [0 0] :time 100]
   [:move :up (/ md 2) :left (- 5) :time 150]
   [:move :to [0 0] :time 100]))

All in all it was a pretty fun project. Although I remember somewhat struggling with ClojureScript One initially. Next time though I’ll instead try out Noir.

Enjoy!

About these ads