I’d been itching to do a bit more Swift development recently but hadn’t had much spare time. Plus, every time I set myself a small project, it quickly grows arms & legs and ends up another one of those things I started but never got close to finishing.


So I thought I’d just pick up a book and spend a week or so working my way through it. That way I’d get some more hands-on Swift experience and actually have a pretty good chance of finishing something.

Picking a book from the seemingly endless number of Swift titles out there isn’t easy, but in the end I opted for Game Development with Swift, which was published by Packt, who just happen to be the chaps who published my own book a few years back.

The book ticked all the boxes for me: it didn’t focus on teaching you the language; it covered Apple’s excellent SpriteKit graphics framework; it was fairly short and to the point; and it also promised to show you how to build your own endless runner game. In fact, I was extremely impressed by the author’s ability to lead you through the process of building a game. He did an extremely good job of introducing new game concepts and then applying those concepts to your project’s code.

In fact, the author did a similarly good job when it came to introducing language features that may trip-up those new to Swift. While the book doesn’t necessarily teach you Swift, anyone with a few years programming experience under their belt should be able to pick things up without too much trouble. It was written before Swift 2.0 was released so there are a couple of code fixes you’ll need to make in the final few chapters. However, it’s nothing you won’t be able to figure out for yourself.

Game Development with Swift is an enjoyable title and does a great job of highlighting just how easy Apple’s new programming language is to work with. You’ll also come away with your own little endless runner game and an appreciation for how awesome SpriteKit is for quickly bashing together 2D games.

The book’s author, Stephen Haney, deserves a lot of praise for cramming so much into such a small page count and also for the way he effortlessly takes you through the process of building a small game. If you’re looking for a quick introduction to Swift and SpriteKit then you should definitely give Game Development with Swift a read.

If you don’t quite have the confidence to jump straight in without knowing a bit more about the language then why not work your way through my Quick Start Guide to Swift tutorials first.

stored in: Flash and tagged: , ,

I thought I’d finish up my recent round of WebGL experiments with the cast of goodies from Corgi Warlock. Don’t they look great!

Oh and a huge congratulations to my buddy Alex for getting his Corgi Warlock game green-lit on Steam. Alex has been feverishly working away on it over the last year or so. I’ve absolutely no idea where he finds the energy or stamina to pull something like that off. Great work dude!

stored in: Flash and tagged: , ,

Today’s WebGL experiment is actually a character from WeeWorld. Say hello to Jeff the Unicorn everyone. Jeff hates being a unicorn by the way. Whatever you do, don’t call him cute.

For this experiment I chained together a series of separate Jeff animations. One of him puking, another of him farting, and finally one of him squeezing out a rainbow poop.

To add an element of randomness to proceedings I laced some JavaScript throughout the FLA’s timeline. When it gets to the end of each animation, a random number is thrown and a decision is made regarding which animation to jump to next. All fairly basic stuff but it does help give a little more life to things.

Oh and as a side note. I once worked on a cool iOS game prototype based on Jeff the Unicorn. Take a look at a video of it here.

stored in: Flash and tagged: , ,

This time we’ve got a fishy foot soldier. I thought I’d drop in one of Alex’s death animations along with a walk cycle. It works quite well don’t you think.

I’ve just realised that Alex’s original animations are all set to run at 8 frames-per-second whereas I seem to have accidentally cranked everything up to 16fps. Shhhh, don’t tell Alex or he’ll make me re-publish everything and upload it all again.

Anyway, I think they look great at this new frame rate :-)

stored in: Flash and tagged: , ,

Another one of Alex’s characters from Corgi Warlock.

I absolutely love the baddie’s flaming sword!

stored in: Flash and tagged: , ,

I had some fun last week mucking around with Flash Professional’s WebGL publish features. My buddy Alex very kindly sent over some character animations from his Corgi Warlock game so I set about converting them for WebGL.

All of Alex’s original artwork and animation was actually produced using Flash so getting them working with Flash’s WebGL publish target was actually pretty easy. And the really awesome thing about targeting WebGL is that your content will run quite happily on mobile browsers too. Hurray!

I’ll publish a few more animations over the coming days.

stored in: Flash and tagged: , , ,

Looks like Flash Professional will be getting some attention at this year’s Adobe MAX. Focus seems to be on the latest drawing and animation improvements, and also Flash’s HTML5 and WebGL publish targets.

Here’s a list of the sessions and labs that’ll be on offer:


As you can probably guess from my most recent posts, I’m pretty excited by Flash Professional’s HTML5/WebGL support. It opens a huge number of possibilities for those wishing to target mobile browsers and, in many ways, makes your Flash content a first-class citizen within a web page.

One thing that’s lacking at the moment however, is a decent number of tutorials and other resources. Thankfully Lynda.com has just released a video course, HTML5 Canvas and WebGL in Flash Professional CC. It takes you through the steps required to make several types of content including vector-based animation, interactive banner ads, and simple HTML5 games.

It’s still very early days for the technology, but being able to build Flash content that runs outside of the Flash plugin is an exciting prospect.


It’s not often you see updates to the ActionScript 3 class APIs these days, so I was pleasantly surprised to see that the AIR 19 beta introduces two new methods to the Vector and Array class:

  • insertAt()
  • removeAt()

They are intended as a replacement for the splice() method when you only want to add or remove a single element. So why use them over the splice() method? Well both methods make a change directly to the array or vector rather than creating and returning an altered version. They’ve been implemented with performance in mind and will perform better than the existing splice() methods.

To show the new APIs in action, here are two quick examples.

In the first example I add a score of 800 to the 2nd element of a vector of high scores:

var topScores :Vector.<int> = new <int>[1000, 500, 250, 100, 50];
topScores.insertAt(1, 800);
trace(topScores); // [1000, 800, 500, 250, 100, 50]

And in the second example I remove the lowest score from the array and trace it:

var topScores :Vector.<int> = new <int>[1000, 500, 250, 100, 50];
var lowest :int = topScores.removeAt(topScores.length - 1);
trace("The lowest score of " + lowest + " was removed.");

You can download the AIR 19 beta from Adobe Labs.

stored in: AIR, Flash, iOS and tagged: , , ,

The beta release of Adobe AIR 19 has landed and the big news is that we finally have the AS3 Workers API for iOS.

So what are Workers? Well put simply, Workers lets us create multi-threaded AIR and Flash Player applications. This is significant because you can finally relegate CPU intensive tasks to a background worker thread while your main application thread continues to do its own thing. So for example, you could write code to perform some heavy image processing in the background without your app’s UI being blocked. In fact, this is one of the primary reasons for using workers: to ensure your app’s user interface and animation stay as smooth as possible even when there’s a lot of processor intensive code being run.

You can find the API documentation for the Worker class on Adobe’s official AS3 Language Reference site. There’s also the Introducing Concurrency on iOS article on the Adobe Developer Connection website, which will help you get started.

And if you want a more detailed introduction to workers then take a look at Shawn Blais’s excellent tutorial on the subject. Part three is particularly interesting as Shawn shows the Nape physics engine running in a separate thread to guarantee a silky smooth 60 frames-per-second simulation.

You can download the AIR 19 beta from Adobe Labs.