Tips For Making a Flash Game

Created Sunday, 20 February 2011 18:00 Last Modified Thursday, 27 June 2013 00:05

I recently created my first flash game, and most of my learning came through trial and error. There were many times during the experience where I realized things that I wish I had known at the beginning, and these are the three main tips I would like to give to other people considering doing the same thing.

First, You Will Need Help

No one is going to be a true natural at this, in order to develop skill you're going to need good sources to learn from. The following were the resources I turned to throughout my development process:

AS Gamer - This was the site I learned the most from in developing my game. The tutorials are well written and easy to follow, and the code examples are invaluable to first time developers. I also liked how this wasn't just a how-to site, the authors also explain why you should develop in the prescribed manner. Using the principles learned, you can then apply your knowledge to create a game different than the ones produced in the tutorials. In addition, there are also several great articles on getting sponsors and marketing your game.

FlashKit - FlashKit is a great source of articles, tutorials, and resources for flash development. The site features thousands of royalty free sound loops and effects that you can use to make your game a richer experience. If you have a question in your development process, the best thing to do is search the forums of this site - it's probable that another developer has run into the same problem. If you still can't find what you're looking for, you can post your question, just be prepared to wait a while for a response.

If all else fails, press F1 - Adobe's own actionscript documentation is extremely helpful for learning how to code.

Second, Flash Isn't Perfect (But it's Nice)

The debate about using Flash vs. HTML5's canvas element as a development platform has heated up in recent years, and it seems like everyone has an opinion. The truth is that it's possible to create great games with both platforms - it's just a bit easier with Flash. In order to make an effective flash game, thought, you're going to need to minimize the downsides of using it.

Flash is horrible at error handling - If your user does something that triggers an error, your game may stop functioning correctly, and you may even wind up making their browser crash. Before you release your game, it's going to be important that you eliminate ALL errors. You're going to need to do extensive testing. You'll want to do about as much testing as programming. A benefit of this is that playing your own game will give you more ideas about features and enemies that you can add to it. I would advise you not to do all of your testing yourself, however - because you'll be playing the game so often you'll get a skewed view of its difficulty. Ask your friends to test it, and make sure to take feedback about your game into consideration.

Also, when coding, try not to make things too complicated. The simpler you make your code, the easier it will be to fix your errors.

Flash can have memory problems. There are ways to minimize this, however. In order to add functionality to your game, you're going to need to add a lot of event listeners. These listen for events in the game and make the objects they are attached to move across the stage and interact. When the objects move off the stage these listeners are no longer necessary, but they are still active even though you can't see the object. You're going to need to do some garbage collection and remove these listeners. It's a good idea to start thinking of how you will remove a listener at the time that you add it. The best way I found to do this was to write a function that runs when the object is removed from the stage and removes all listeners.

So, taking account of all these disadvantages, why even develop in flash at all? The answer is because flash is an easy to use development environment for rich, interactive content. Graphics can be imported from Photoshop and Illustrator, and once imported they can be re-opened in their native applications or futher edited with flash's graphics tools. Flash is also reknowned for being an animation program, and newer features like 3D tools and inverse kinematics give you more options than many other platforms. I haven't yet found a program for creating games using the canvas element that is as accomodating to designers. In addition to the design advantages, Flash also has a robust environment for coding which was vastly improved in the CS5 version.

One final note - don't get discouraged if you read about someone bashing Flash, or any other platform you develop in. Just keep making cool stuff.

Third, Start Planning Ahead

Abraham Lincoln once said "If you give me six hours to cut down a tree, I'll spend the first four sharpening the axe." It will be wise to remember this quote and develop a strategy for developing your game and a list of all the features you want to implement.

To illustrate why this is important, I'll share this story: the most frustrating part of my game development experience was adding a pause functionality. Writing the code to actually pause the game was extremely simple, but I didn't do it until I was almost finished with my game. Adding this functionality meant I had to figure out how to stop all of my character animations, and I had to rewrite several character movement functions that had been based on timer events. I had to do this in over 30 files, which was repetitive and time consuming. If I had done a little more planning, I could have addressed all of this early in the development, and it would have saved me a lot of time at the end. Moral of the story: implementing simple features will become more difficult the further you get into your game.

Web Analytics