Game development in progress: Space Invaders clone – update 2

Earlier this year I started developing a Space Invaders inspired game for Android. I started back in March, and have worked on it for a around 20 to 30 hours or so, on and off. Not being an expert in Android development or game development in general, it’s been a learning experience. The book I read back in March, Android Game Development by Example, was a good book to get started. I realize I probably could have got to a playable game quicker if I’d used a game development platform like Unity3d, but I wanted to get to grips with writing a game by from the ground up first. I’ll circle back and probably rewrite it using something like Unity later.

Right now I’m at a point where it’s playable but there’s a few key features I still need to add, like the bases/shields at the bottom of the screen, and the invaders need to shoot missiles at the player. It’s a pretty easy game at this point 🙂 I have a few ideas for some gameplay variations to add too.

I started implementing as a standalone Java app using the Java2d api and the 2d game engine that I’d previously worked on for my first attempt at a game in Java, a version of one of the classic Nintendo Game n Watch games, Turtle Bridge.

I tried to replicate the animation of the invaders moving one at a time, one row at a time and got pretty close:

Compared to current day AAA tier video game development projects which typically have multi-million dollar budgets and teams of artists, story writers, sound engineers, QA, developers, as well as marketing and PR teams, I find it fascinating that Space Invaders was originally developed by a single developer, Tomohiro Nishikado. Not only did he develop the sofware for the game, but he also designed the hardware on which the game runs.

There’s some interesting features of the game that were not part of the original design, but resulted from limitations of the hardware. For example, the invaders speed up as fewer are left remaining on the screen. This is a defining feature of the game, but was a side effect from the 8080 processor being unable to animate a full screen of invaders at the same speed compared to a screen with only 1 or 2 remaining. Rather compensate in software to keep a constant frame rate, this feature was kept.

Other features in the game play logic could easily be overlooked by a casual player:

  • The mystery ship appears on a regular, timed basis, at around each 25 seconds
  • The mystery ship is worth 300 points on the first 23rd shot on each screen, and then 300 on every 15th shot for the remainder of the screen. For all other shots it’s 100 points (if you play for high scores, then this fact is probably very well known to you 🙂 )
  • Missiles from the invaders will not kill the player if fired from the last row on the screen

Here’s a quick video of how far I’ve got so far. This is running on a device simulator, so the frame rate is not as fast as on a real device:

I’ve still got some work to do, but I’m pleased on my progress so far.

Unix source commit history from 1970 to present (and links to other shared commercial source)

A single github repo has been shared that combines historical commits for the Unix operating system going all the way back to 1970.

As a software developer I find it fascinating to look at the source of other software that you use and often take for granted. We’re lucky enough to be able to freely browse source of many open source projects, shared on github and other online repos. You can learn a lot from looking through code written by other developers.

There’s also a many interesting and previously commercial systems that have had their source publicly shared. A few examples that I’ve come across:

MacOS: Opening a Terminal from a folder in Finder (plus, taking and annotating screenshots)

In Windows I like that you can Shift-Rightclick in Explorer and select “Open command prompt here”. During development I often want to do the same on my Mac, and this feature is provided too, but not enabled by default. To turn it on, go to System Preferences > Keyboard > Shortcuts, select Services on the left, and then check the option “New Terminal at Folder”:

If you want to go in the other direction, you can easily open a Finder at your current folder in Terminal by running ‘open .’

A couple of bonus tips:

  • To take full screen screenshot on the Mac, press Shift-Cmd-3. A file will be saved on your desktop. To take a screenshot of a selection of the screen, press Shift-Cmd-4, then drag to outline your selection.
  • In the Preview app, there’s a neat feature under Tools > Annotate where you can annotate your screenshots with highlighted sections, boxes, arrows, text etc. Just open your screenshot file in Preview, and then you can easily annotate and save the image: