18
Aug 13

Toy project: Cathedral

I have neglected my blog during the last few months but that’s just because I was very busy. In the meantime, among other things, I flew 20 times on route Gdansk – London, relocated to Reading (UK), and… started a new toy project :)

Project is called Cathedral and it is an implementation of a board game called Basilica. The core game logic is written in ClojureScript. The web application part uses Angular.js, and wherever possible, CSS for the user interface. I’m thinking about using LESS or generating styles in Clojure as style rules are getting pretty repetetive. It is still work in progress.

Current implementation allows placing tiles on the board in accordance with basic game rules. There are some challenges around bridge-code between JavaScript and ClojureScript – I need to figure out how to avoid cluttering code with calls to clj->js and js->clj functions. Retrieval of CLJS records from JS is also not as straight forward as it should be.

cathedral_screenshot

Why did I choose ClojureScript?

Functional approach is ideal for board games. Just put the whole the game state in one data structure (map) and pass it, or its parts to pure functions. It’s unlikely to encounter performance problems in a board game! :) And Clojure is of course a lot more developer-friendly than JavaScript.

Why did I choose Angular.js?

I got used to a luxury of two-way data bindings in web applications’ frontends, and I am familiar with Angular.js because of my work projects. There are attempts to replicate what Angular.js does in ClojureScript imlementations, such as webfui, but none of those attempts is anywhere outside of pre-alpha stage.

I will share my code when I am done with architectural decisions and applying them to the codebase. Screenshot attached gives an idea of how the game looks like at the moment. Stay tuned! :)

Leave a Reply

Your email address will not be published.