Tower Defense Rising

So my simple tower defense finally has some interaction. You can place towers and you have limited resources. The MVP is almost done.


Bring it on






Over dinner my son mistakenly said “grampbot” instead of “grampa”. Immediately a story idea was formed in my head. An action adventure story where a young robot’s grampbot dies and his robotic kin come to receive of their inheritance. He had some major upgrades, including a lazer arm. The little robot wanted that, or maybe his infrared eye to replace her own malfunctioning eye. Instead she inherits his broken memory chip.

But of course the chip contains a secret that unravels their world and causes ultimate chaos! Bwah ha ha ha!

I drew a picture of her. It isn’t great, I still haven’t figured out digital drawing.


Game UI

It is time to start writing the small but important UI for the tower defense game. The only thing i need to display at the time is amount of resources the player currently has. Whenever I get to this point normally I want to gouge my eyes out.

UI is hard, and in games, it is even harder. The data changes fast, and it needs to be able to get out of the way fast. Game engines like Unity have made great strides in making it better, but even there it is really hard to work with.

Since I’m doing this game in Cordova, I should have an advantage, after all if the DOM isn’t good for UI what good is it for?

I think were I’ve been doing it wrong before is tying the game data directly to UI elemnents. This time, I’m going to write the UI as a component and it will get a dataset as it’s rendering context.

The ui will be reactive, so when the state changes, the ui will change. Nice!

So like this:

game.state = new Model();
game.state.set({resources:game.state.get("resources") - 100)
// ui
ui.listenTo(game.state, "change", function() {...});


Translate Scale Rotate

I knew I wouldn’t be able to do a great job with multi-touch gestures. Not full transformations, but I was really curious on how difficult they would be. I managed to get a decent translate and scale going, but it was pretty jittery.

I decided that the npm package “nudged” would work perfect for me. I had to do some changes to my event handling system to make it work. Like when the touch set changes, I lock in the current camera matrix so that all transformations with that set are uniform.

The result is pretty nice. If you look close you can see where windows added the touch marks.


That’s one more item done for the TD game.

Android vs Apple Smackdown

I’ve long had the debate within Morphosis Games that we should target cross platform rather than just one platform (In particular iOS).

The argument is that iOS is the big money maker, so that should be our first and primary market. Judging by the latest download of the recently released Fairy Tale Twist, this might be true. Certainly iOS leads in number of downloads.

Though we, being the empirical sciency types at MG, decided to do a real test.

MG will try to complete a very very simple tower defense game. One just for iOS, and another written in a cross platform framework (cordova, using webgl for performance). We’ll throw them at the app store and make a comparison.

We’ll also compare the time it took to make the apps and if the apps are comparable (as we know that cordova being HTML5 based is likely to suffer from lag more than a native solution).

Even if Android has less downloads if the time it takes to make the app for both is comparable to native, and the feedback is generally the same, well, then maybe cross platform will win. If not, then iOS for the win.

Let the games begin!