I shipped an Android game in 9 days and you can too
Tags: gamedev, html, javascript
Published: 2020-09-11 09:34:05

My game [Central Park Nanotech Warlex is finally available for a buck on Google Play](https://play.google.com/store/apps/details?id=cx.mccormick.warlex), hooray! \o/

<a href='https://play.google.com/store/apps/details?id=cx.mccormick.warlex&utm_source=devto&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png'/></a>

This post is about how I made the game and got it live after nine days of work, and how you can do the same.

The schedule went like this:

 * Day 1: Kenney Game Jam 2020.
 * Day 2: Kenney Game Jam 2020.
 * Day 3: Got the Android build working.
 * Day 4-8: Bug fixes & improvements based on feedback.
 * Day 9: Google Play submission.

Of course I was also doing my freelance work at the same time because my kids have to eat. 😂 Wouldn't it be great to be a full time game developer?

Anyway, here's how I made it work.

### Hack #1: Re-use existing code

The first thing I did was to use an existing codebase to bootstrap my game. I used my product [Roguelike Browser Boilerplate](https://chr15m.itch.io/roguelike-browser-boilerplate) but there are a ton of other ways you can get a head start. For example you could:

 * Start with an existing open source game.
 * Use a plug-n-play game engine.
 * Use open game art assets from e.g. [kenney.nl](https://kenney.nl) and [open game art](https://opengameart.org) and [Lost Garden](http://www.lostgarden.com/search/label/free%20game%20graphics).
 * Use good libraries for your preferred language.

A huge mistake many amateur game developers make is trying to build everything, including the game engine, from scratch. Unless your goal is explicitly to learn rather than ship, you shouldn't do this.

My interest is roguelike RPG games and you can find art assets and libraries for Javascript and Python to make it easier to build that type of game. The same is true for most other genres of game too like platformer, FPS, RTS, etc. - the tools are out there so go find them.

### Hack #2: Use web tech

I build stuff for the web first because I know that browsers run everywhere. Browsers can do everything you need a game to do. They can play sounds, show graphics, do 3d, take input, etc. There are also a [ton of great game engines for the browser](https://html5gameengine.com/) now.

Projects like Cordova and Electron mean we can bundle our app together with the browser and ship binaries for every platform very quickly. You don't have to start with binaries though because another advantage of building for the web means it is extremely easy to get your game in front of testers. They don't have to download anything, you can just put the game online somewhere and give them a secret URL to access it.

So, leverage web tech so your game can run *everywhere* in the future, is quicker to code, and is easy to deploy for testers now.

### Hack #3: Do a gamejam

Game jams are a **great** way to hack your motivation. Because you know they are time boxed it's easy to crunch for the period of the jam. It also forces you to keep your game scope small and focused which usually results in a better game.

Even though I made the core game in just two days during Kenney Jam 2020, people already seemed to like it:

> ![Review 1](https://dev-to-uploads.s3.amazonaws.com/i/jn9a8a11g8wbqigt3bho.png)
> 
> ![Review 2](https://dev-to-uploads.s3.amazonaws.com/i/uojnouhlbschx3lsh7m1.png)
> 
> ![Review 3](https://dev-to-uploads.s3.amazonaws.com/i/2vtw36wrrr8xf7r3a6fw.png)

This gave me the motivation to go ahead and publish it.

I then spent a few days after the game jam fixing bugs people found and polishing the game up before shipping it.

### Hack #4: Use Cordova to build for Android

I had previously built Android apps with Cordova and it was cool, but it seems this has now got even easier. The basic steps are:

 * Make sure you have the Android SDK installed.
 * Make sure you have Java installed.
 * Get cordova installed with `npm i cordova`.
 * Create a default project.
 * Copy your web files into the `www` folder.

You can then start testing the app on your phone. Once your build is ready for production you do a release build, sign it, and upload it to the Google Play dashboard.

There is some trickiness around getting all that installed and doing package signing. I set up a `Makefile` to automate most of this and do it repeatably. I'll to do a [screencast on my YouTube channel](https://m.youtube.com/user/mccormix) in future explaining all that so if you're interested stay tuned!

After all this you wait a few days for the ~~Gods~~ Google to approve your app and then...

### Shipped!

So that's it, that's how you ship a game in 9 days. Thanks for reading!

PS Check out [my Itch page](https://chr15m.itch.io/) if you want to see my games and from there you can [sign up to the infinitelives list to be notified of new releases](https://infinitelives.github.io/).