There was a time, more than 20 years ago, when every friend I had as a kid wanted to be a computer game programmer. We all had different computers (Atari 800, Apple IIe, Commodore 64, IBM PC XT, TRS-80, Ti-99 4/A), and we all fought over which one was the best (Atari), and yet we all fell in love with the idea that we could program our own games on our own home computer. This was the age when the arcade reigned supreme, and games like Asteroids, Galaga, Time Pilot, Pac-Man and Donkey Kong, were revered as the panacea of game design and playability. We were disappointed by the home versions on the Atari 2600, and Colecovision, and we were sure we could do it better on our own computers. However, to the kid, nearly everyone failed. We did not know how to program well-enough, and our 8-bit computers were not powerful enough to mask our lack of skill. Through the next 15 years or so, there were some advances that made making games easier (STOS, Click And Play, VB, Director), but for the most part, creating games was left for the hardcore C++ programmers. This left most mere mortals, who had interesting ideas but were not accomplished programmers, out of luck.

It was not until Flash 5 was released almost 8 years ago, that the playing field started to change. Flash, while not an easy development system to grasp at first, created a cross-platform game development tool that was powerful, yet could be mastered in much less time than anything previously released. The key to this was the Timeline and ActionScript. The Flash IDE helped take care of graphical tasks, while the powerful scripting language could take care of game logic. Even though it was a rather primitive start, by the time Flash 8 and ActionScript 2 were released the develop environment had advanced to the point where nearly any type of 2D or 2.5D game could be created, given the proper effort. This has opened the door for almost anyone (kids, teenagers, adults and kids at heart) with the right amount of determination and drive to finally bring their creations to life. It’s a fantastic time if you enjoy games, because the game ideas of thousands of people are being unleashed. New genres are being created daily, with new talent emerging with them.

However, the one drawback to this is that the code being created doesn’t always match the ideas being put forth. ActionScript can be all over the place, in-line functions can be spread throughout MovieClips, and Flash source files can quickly become unmaintainable messes. To fix this problem, one must take some lessons from the “serious” programmers and their object oriented C++ code. There was nothing wrong with what those hardcore C++ programmers were doing all that time, and there was a good reason they were doing it, it was just not accessible to the masses. In fact, efficient, well-designed games that can stretch Flash to its limits need to utilize some of the basic ideas of Object Oriented languages like C++ and Java to be successful. That is what this series of tutorials is about — taking a seemingly basic game idea, and showing how it can be implemented in a straightforward manner using some of the Object Oriented features of Flash 8 and ActionScript 2.

Over the course of several lessons, I will be describing in detail how to create a very basic game in Flash. We will be building a very simple shooting game named “Home Computer Wars”, inspired by all my friends who wanted make games in the 80’s, but never succeeded. In this game you will play “Atari” in an attempt to fight off the onslaught from IBM, Apple, Commodore and Texas Instruments computers.

Tutorial Outline:

  • Lesson 1: Game Setup - We first learn how to set up our game framework in Flash, and then create a player that can move and fire missiles.
  • Lesson 2: Creating Enemies & Game Environment - We add a scoreboard and waves of enemies that gradually get harder and harder to fight.
  • Lesson 3: MochiAds, MochiBot, and the MochiAds Leaderboards - We add MochiAds, MochiBot and the MochiAds Leaderboards service
  • Lesson 4: Finishing Touches - Balancing And finishing: Level Balancing, Sound fx, Logo Screen

We will be coding this game in ActionScript 2, however we will be using an object oriented messaging system that can, with some effort, be ported to ActionScript 3.

Read the rest of the series: ‘Anatomy of a Flash Game’

  1. Anatomy of a Flash Game: Lesson 1 - Setting up the game
  2. Anatomy of a Flash Game: Lesson 2 - Creating Enemies & The Game Environment
  3. Anatomy of a Flash Game: Lesson 3 - MochiAds, MochiBot and MochiAds Leaderboards