As with most adolescent males, I have always been into gaming, having owned an Amstrad at 6 years old, wasting hours playing games like bomb jack. We all remember waiting for what seemed like an eternity on those old tapes to load!
Gaming intrigued me more so because I was curious as to the inner workings and mechanics that drove the games.
I wrote an essay back in college, on the history of gaming, and it was fascinating to me just how far it had come in the mere 30 years since its inception.
I always knew that it would be an industry that I would love to work in.
After a few years of working in web development, I decided to dive deeper into the guts of gaming, in an attempt to vary the work I was doing.
Mobile gaming always stood out to me a bit more, as it seemed like an easier market to penetrate, and with the advent of smart phones and developer programs for iOS/Android, it lowered the bar for developers to get their work out there. I decided to research what was actually required to get a game to the app store.
So, did I want to build an native iOS game?
Also, if I the game was to run on the android platform, I would have to port the code to Java and use the android SDK. Not so much fun!
Enter Phonegap, or now as it is known: Cordova.
It all sounds too easy, right?
If you plan on writing a really heavy duty blockbuster 3D game then you might want to consider writing a native app, as with the performance of a native app over an app built with Cordova, there is simply no comparison.
I will start from scratch with some simple animations and x/y coordinate manipulation so as to give you a better understanding of what the physics engine is actually doing for you once we hook it up! We will tinker with a framework called CanvasQuery which is a simple JS library for controlling your game run loop. This will allow you to read some input from the mouse/keyboard and control an on screen character, essentially creating a really simple game.
Once we have this up and running I will show you how to use Cordova to translate the game to an installable mobile app.
I will show you how you can read from the devices sensors (Accelerometer), via the Cordova API.
Then we will dive into some really interesting stuff, and what I find most interesting in Computer Science. Artificial Intelligence.
I will introduce some AI concepts into the games, such as hooking up a neural network to control other players.
This blog assumes some knowledge of HTML/Javscript/CSS and also some JS tools such as Grunt/RequireJS/Bower, but if you do not know these technologies too well, fear not.
Our primary focus here is on the gaming side of things!
Knowledge of Vector maths might also be a bonus when we get into some more advanced graphic rendering and line of sight algorithms, but again not essential!
I will link to the Box2D docs and any other required documentation for any plugins/frameworks I bring into the mix!
It will never be as sharp as it's native counterpart, but for the simplicity and effort involved, I think that this route to creating a mobile game should be something you consider!
If you want to see a live demo of some of the things I have been playing around with, see: