Thursday, December 4, 2008

The Code!

Obviously this blog has fallen into disrepair but the code I promised is still coming. Behold:

Actionscript Code

I have been keeping a lot more updates on my site at though none of them are areally related to programming, it is still a much more interesting site.


Thursday, June 5, 2008

Finished product

My game project is now officially finished and released. It can be viewed here:

I know that it takes a long time to load and I know that the branding is cheesy but the game is solid and functions well. Today I will explain how this project came about and go over some of the tools I developed for it.

One of our company owners sold a client on the idea of a flash game to promote his new child-centered campaign. In the IT department we didn't have much direction other than . .

it's a game about a duck
some kind of flying would be cool

Knowing the environment we needed to work in (flash) and having a set budget that limited us to around 400 hours we began to research game ideas which lead us to the super M game from free world group.

This gave us a basic concept to work on and it was time to involve an illustrator. Most flash games have a similar visual style because they are made by flash people that use flash for art and many of them learned to make games from the same tutorials. It was never an intention of ours to break away from the mainstream look but we aren't a flash shop and so our graphics don't look standard. Anyway we had graphics prepared for obstacles, collectables, menu screens, and instructional pages as well as our main character the duck. There are four levels that each have a distinct look; snow, city, forest, and country.

In learning actionscript 3.0 I found that I needed a lot of helper classes which I wrote and will make available shortly. These include:

A class that automates the loading of bitmap image assets in a group. Takes url strings as input and encapsulates the process of loading all of the images. Maintains a volatile Number representing overall load progress going from 0.0 to 1.0. Dispaches an AllLoaded event when finished and locks it's own data until it is cleared (this prevents a new entry from being added so there can be no confusion from some images being loaded and some not).

Adapted from AssetLoader to load in data files, in particular XML files for my game. Operates in much the same way as AssetLoader but on a different type of file. These are distinct from one another because flash uses different load methods for data than for images.

Defines the properties of a simple 3d camera for movement through an environment. Controls the viewing area and the focal length which determines rate of scaling with distance.

In addition to applying the abilities of AssetLoader to mp3 sounds (the only externally loadable format in AS3) this class also manages the playback of sounds and maintains a thread pool of all sound channels in use. You are also able to do common useful things for the purpose of a game such as turning music off and on, turning game sounds off and on and stopping and resuming all playback (as in when the game is paused and resumed).

An extension of the actionscript Sound class this class adds in a few parameters such as how you want the sound grouped (music or effect), and a playback offset value. This offset takes care of a deficiency in the mp3 format that introduces blank space at the beginning of a sound. (This creates a major problem with the event based sounds in a game because it introduces a delay and prevents the player from feeling immersed in the experience.) This class is used by the SoundManager class.

So thats all for now but check back soon or subscribe if you prefer. I will be releasing the code related to all of these tools through this blog along with explanations of what prompted each tool to be created and how those problems were solved.
Also if you have read along this far here I recommend you go ahead and pick up this book on AS3.

Tuesday, May 20, 2008


Hello random reader.
My name is Jonathan and I am currently [5-20-08] nearing the end of development for my first full featured commercial video game. When I was going to school as a programmer I thought of video game development as unattainable. It was the larger than life harder than hard to break into career that I wasn't even going to try for. While that appeared to be the case in 2002 now it is not. Casual games have become a real money maker and now I'm actually a small part of that.

The game I have developed was in flash using Actionscript 3.0. It is a "flying" game that simulates 3d movement through space using 2d imagery. This technique has been used before in flash and it also dates back a long way in arcade and console gaming. It is the same technique used in Sega's Afterburner and Space Harrier games from the late eighties.

I plan to use this blog (something I never thought I would do) to walk through the things I learned and to offer some of the helper tools I built to the public. These include a class to manage loading in external images in mass and displaying a loading status, a class to manage sounds in a thread pool so that, for example, all sound could be stopped and then resumed as when a player pauses the game, and classes to handle the creation and management of a limited 3d environment. More than anything I hope to give someone a good resource for understanding the peculiarities of Actionscript based game development and a way to get past all the little snags that you're bound to hit when entering that world.