This is the personal website of John Watson: father, software developer, artist, guitar player. Follow me on Twitter or Instagram or itch.io or GitHub

#1GAM March 2013: Reverse Invaders

May 31, 2013

http://www.youtube.com/watch?v=OQZ8xB8lYBI

The game is inspired by Space Invaders but in reverse. You don’t control the invaders or the humans but you can move your mouse pointer over an invader ship to activate a temporary shield. Try to get as many invaders as possible to the surface before they are slaughtered. Oh, and the invaders say 51 different things! Amazing!

I wrote this game twice: once as an HTML5/Javascript game built with the Crafty engine and again with NME which builds to native desktop apps, Flash, Android, and iOS. It started as a demo project to learn Crafty and the quirks of Javascript for game dev. Chrome performance of the Javascript version is slightly better than Firefox. I haven’t tested in IE at all. But I was disappointed to find that running the Javascript game on mobile was a problem. PhoneGap worked but the frame rates were bad (<5fps). CocoonJS looked promising but didn’t work at all. So I tried NME. While it isn’t perfect, it did allow me to build Flash, Linux, and Android apps from the same code all running at 60fps. The source code and all assets for both versions are at GitHub.

Crafty is a capable engine and it was fun to use. The javascript game features over 500 on screen entities (each bunker is something like 100 individual entities and there are 150 stars), particle effects, sprite animation/rotation/alpha, collision detection, and multi-channel sound. I also wrote a minimal sound manager and an object pool.