Clone the Classics – Space Invaders with Swift and SpriteKit

Following on the heels of Asteroids with Sprite Kit, the introduction of the Swift language made me feel like another crack at the whip. So here’s my take on Space Invaders. This time, I went for OS X as a platform, again using SpriteKit, but this time using Swift as the primary language.

SpriteKit Space Invaders

One thing from my Asteroids app I wasn’t entirely happy with were the simple graphics, relying on SKShapeNode to approximate the vector-based ship and titular Asteroids. With Space Invaders, vectors weren’t really an option, so this time, I got serious about my graphical assets.

I got hold of a nice font for scores and the like from Fonts2U, and a second font that provided a near-complete set of authentic-looking sprites from

What’s missing

I’m not quite done yet! Most noticeably, there is currently no sound, and no two player mode (but I left the second player score in there for the aesthetics). I also need to add missile animations and tweak sizes and speeds to better match the original.

Thoughts on Swift

As a first impression, I love Swift as a language. It’s got a really nice balance between the learning curve and the power available to a developer. Developing using Swift has certainly been a lot quicker than Objective-C.

I was working on this project through a few of the XCode betas prior to the official release of Swift, and a lot changed under me while I worked. Every time for the better, clearing up some annoyances or taking away the need for the odd hack I’d resorted to.

However, I’m not sure how quickly Swift might supplant Objective-C as the primary language in anyone’s toolbox. The big hurdle may well be OSX support. iOS updates have a great track record for user adoption, but historically, OSX upgrades haven’t happened so quickly – although Mavericks greatly improved these rates. You can only build Swift apps for the last two versions: OSX 10.9 and up, and iOS 7 and up, so time will tell if the free Yosemite upgrade makes Swift development viable.

While you can use Objective-C libraries in Swift, there are a few places where the abstraction isn’t clear or breaks down (handling #defines for example), so there’s a little bit of fiddling to cross the barrier. Besides which, CocoaPods - an awesome dependency manager for XCode projects – shows no signs of supporting Swift any time soon.

For the time being, I’m going to take a hybrid approach, using Objective-C for some libraries, and Swift for the main UI. Hopefully I’ll be able to go fully Swift soon.


Want to play around with my code? Feel free! You can check out the full source below:

[Source on GitHub]

Test your Twitter Vocabulary

TwitterTime for another quick project! This time, I’ve put together a vocabulary tester for Twitter. Just put in your twitter handle, and get an outline of your most used and longest words.

The app is implemented under Laravel, using the Twitter APIs to pull tweets for processing. To get around potential memory and time contraints on PHP scripts (and to provide feedback on progress), I used AngularJS for aggregation and rendering of results. Bootstrap and Font Awesome provided quick styling. Readmore »

Quick Project: Asteroids with SpriteKit

After an extremely long hiatus from my Shoot ‘Em Up project, I was itching to see what was new in the world of iOS game development. Discovering the new SpriteKit API, I just had to give it a try. So I put together a quick version of Asteroids over a few weekends.


It’s missing a couple of features (no hyperspace or flying saucers), but was a great way to get to grips with the new API. Not only that but I also got an excuse to play with Git’s submodules feature, which I’m sure I’ll be using a lot more in future.

You can see the full source on GitHub, feel free to download and build a copy!

2^n: A silly 2048 extension

Last week, I got hooked on 2048 after playing the Doctor Who Edition obsessively on my lunch break.

Unnecessarily excited with the powers-of-twoness of the game, I forked the code and let you play a slightly bigger version (or two).

2^n Screenshot

Readmore »

What a Difference a Frame Makes

This afternoon, I was walking past a construction site and did a double take. Part of me could swear I’d just walked past a mirror, but hadn’t seen myself in the reflection. After a brief moment of vampire-based self doubt, I stepped back a few paces and saw this:

Readmore »

Reviving an old habit, but a good one

I admit, I expected to get a little further with my blogging goal before missing a week, let alone two. Or three. I’ve kind of lost count. Suffice to say I’ve had a hard February so far. I won’t go into details, but I’m coming out of the other side feeling better than I have in a long while, and I’m eager to crack on with some self improvement. First stop, finally joining a gym in NYC.

Readmore »

GOG – A Video Game Nostalgiagasm

GOG LogoAs any mobile video game developer from the first wave of smartphones can tell you – a small group, but a proud bunch – nostalgia sells. So if you were a PC gamer in the 90s and 2000s, might be right up your alley.

I’ll admit, I’m not a big gamer, I’ll occasionally get hooked on a story based game here and there, but I’m not the sort to spend hour after hour fragging whiny teenagers or trolling frustrated Call of Duty players. But I do get misty-eyed when I think of my childhood days playing wonderfully crafted low-res strategy or point and click games. And luckily, some part of me has managed to ignore all the frustrated hours spent trying to get DOS to actually run those games (does anyone know what an IRQ setting actually was?).

Readmore »

App Review: Level Money

Your spending allowance, and that's it.

Your spending allowance, and that’s it.

I hate budgeting. Compartmentalising my spending into arbitrary, inflexible ring-fences I can’t possibly stick to has never seemed to work, for some reason. Luckily, someone’s come up with a budgeting app that doesn’t actually require much budgeting.

Level Money is a new money management app for iOS and Android that tells you simply what you can spend each day. And that’s all. You don’t have to predict how much you’ll spend on food, you don’t get stuck deciding which bill to ignore because you needed a new winter jacket. All you need to do is to watch what you spend for the day.

It’s beautifully simple and perfect for someone like me who isn’t organized enough to do a weekly food shop. It’s the app I’ve been waiting for since I moved to Manhattan with it’s eye watering rents. In fact, I was working on something similar myself when Level was released, and I was delighted to see they got it right! Readmore »

How to Configure Laravel on MAMP

Laravel is a powerful framework to speed PHP web development, MAMP is a handy GUI to allow quick and easy testing of websites on OS X. Smash them together and you get quick and easy web development on OS X.

My work at Spotflux has recently involved a lot of PHP development to build an account management portal for our new Premium service. This had to tie in to our exiting web APIs (which I’ll admit were a little cobbled together) and be backwards compatible with our existing database. And it had to be done yesterday. Readmore »

Where the heck have I been?

Shockingly, it’s been over six months since I last posted to this blog. But this isn’t because I’ve been lazy, uninspired or disillusioned. I’ve just been extremely busy through a combination of a new job, moving abroad and getting caught in a hurricane.

In April, I took a new job at a New York based startup, spotflux. spotflux (lower case ‘s’ intentional) provides a free VPN service designed to protect your privacy and security. All you need to do is download and launch the app, and it will encrypt all your internet traffic, block ads, malware and tracking code and provide you with an anonymous, US IP address.

Readmore »

Social Widgets powered by