How to make Flash games with Actionscript 3

Ranked #1,029 in Computers & Electronics, #15,946 overall | Donates to KIVA

A comprehensive guide to begin game programming in Flash

Have you ever played a flash game on the internet and wished you could make your own? Have you ever thought, "I could make a better game than this... if I knew how"? Have you ever considered the revenue you could make from the millions of plays that some games get?

Whether it is for a hobby or a full-time career, the flash game development community is filled with thousands of people who have asked these same questions. And they all started at the same place: no knowledge of programming or game design. Whether you are an absolute beginner or an intermediate looking for some tips, I am here to teach you to make games like the professionals.

I'm not going to pretend that programming games is the easiest thing to do in the world. Learning it takes time and dedication. But if you are passionate about games and programming, you can make some really amazing things.

In this page I will try to direct you to what I think are some of the best tutorials and resources on the web. There are a ton of such sources all over the internet, and it's possible to waste a lot of time trying to sort the best from the worst. That's what I've been doing for the past two years, and here is the result.

If you are a beginner, continue reading from here, or visit my tutorial blog here.

If you are an intermediate looking for some good tutorials, click here to jump to that section.

If all you need is The Big List of Resources, click here to jump to that section.

Programmer Poll

Personally, I've been programming for just over 2 years (although I've been looking into game programming for a while before that). While I know I'm not a complete expert, I have gained a lot of knowledge that I want to share with you all.

Loading poll. Please Wait...

The Basic Steps to Learn Flash Game Programming

  1. Download Flash Professional
  2. Learn to navigate the Flash interface
  3. Learn the very basics of programming
  4. Follow as many beginner tutorials as you can find
  5. Try to make your own (simple) game -- ask for help if you need to
  6. Post your games online and learn from your mistakes
  7. Read more tutorials, blogs, forums, etc
  8. Keep making your own games, a little more complicated each time

Getting Started

Downloading and Getting to Know Flash

Flash games can be made with a variety of tools, but the best one (the easiest to use) is Adobe Flash Professional. You can download a FREE trial of Flash here.

Don't buy it at first, because it can cost you upwards of $700!! That being said, if you are a student or a teacher you can buy it at about a third of the cost. And if you don't want to pay for Flash Professional, there are a few free tools out there that you can use to create flash games, such as FlashDevelop (a free AS3 editor for Windows) or Stencyl (a Flash-made-easy gamemaker), but I am going to focus on using Flash Professional (this includes CS3, CS4, and CS5+).

Once you have that downloaded, you need to learn the basics of the program. You can read this long (but very good) guide by Adobe here or another Adobe guide here.

Or if you have a short attention-span like me you can just watch this short video below, or watch the free Getting Started With Flash section on this website.
(I especially recommend the "Touring the Interface" clip)

A Pro-tip to learning flash: Use Google. A LOT. If you have a question, chances are someone else has already asked it online. Use this to your advantage.

Learning the Flash Interface

A brief introduction to navigating the Adobe Flash Professional interface.
powered by Youtube

I highly recommend this book

One book will save you countless hours

While you can certainly learn to build flash games by using only online tutorials, it is much faster to use a paid resource. By charging for a book, authors are able to include lessons of much greater quality and depth than they can afford to include in free tutorials online.

Flash Game Development by Example

Amazon Price: $40.90 (as of 06/01/2012)Buy Now

"Build 10 classic Flash games and learn game development along the way with this ultra-fast paced game development course."

"Ideal for readers with no Flash or game programming experience."

Written by acclaimed blogger Emanuele Feronato, this book will take you from zero to hero in 328 pages.

Beginner Game Programming Tutorials

Once you have a basic grasp of flash, the absolute best way to learn (for free!) is to read tutorials online! Here is a list of the one I think are the most useful for a beginner.
The Avoider Game Tutorial - Michael James Williams
This is basically the pinnacle of the flash gaming tutorials for beginners. Michael J Williams takes you through 12 easy-to-follow steps to make an Avoider game complete with many features. After you complete this you will feel very confident with the basics of AS3.
Getting Started with AS3: The Absolute Beginner - AS3GameTuts
(Shameless self-promotion) The post series on my blog teaching the basics of coding to the absolute beginner.
How to Create a Brick Breaker Game in AS3 - Flash Game Tuts
A great tutorial aimed at the beginner that helps you build a working Brick Breaker game.
AS3 101 - ActiveTuts+
Are you new to ActionScript? The AS3 101 series is an ever-growing course of tutorials aimed at helping everyone with ActionScript 3.0 fundamentals. This professionally-made series will bring you from 0 to 60.
Number guessing game in AS3
Create a simple higher-or-lower guessing game in Flash AS3
Flash ball game creation tutorial - Emanuele Feronato
This is a quick tutorial that shows how to move a ball around using the arrow keys. Useful.
Kongregate Labs
This is actually written in AS2, but it's a great series so I couldn't leave it out.
Getting started with ActionScript | Adobe Developer Connection
Adobe's official hub for learning Actionscript 3.

Creating Your First Real Game

OK, so if you've checked out any of the above tutorials or books, you should have decent understanding of Actionscript. I know it can be confusing, but the more you work with it the easier it gets. Trust me.

So what's next?
Making you first real game.

Sure, you've probably made some with the help of tutorials, but it is a HUGE accomplishment to create your own original game.
That being said, a great way to develop your game programming skills is to try to build off of a tutorial. Take the finished product of a tutorial you completed, and then play with the code -- adding features, changing the art, figuring out new ways to do things.

A word of warning: KEEP IT SIMPLE. I can't tell you how many times I've seen people try to create giant RPGs as their first game... and then completely fail.

So what should your first game be?
FreelanceFlashGames has a quick post on the subject here.

Be creative! If you have fun making the game, your players are sure to have fun too!

And if you need help, ask!
My personal favorite forum to ask on is the Kongregate Programming forum. The users are quick to respond, and are very helpful if you ask nicely and aren't too lazy.

Uploading Your Masterpiece & Earning $$$

Now that you've got an original game, it is time to upload it to the mass audience of the internet. You attract fans, learn from your mistakes, and even earn money!
Kongregate
Sign up for Kongregate. It's a great platform that you can upload games to instantly, and have thousands of people play and comment on them.

Even better, Kongregate shares a generous percentage of their ad revenue with developers, and has a highscore and achievement system you can implement.

My #1 upload recommendation for game developers.
Newgrounds
Another great option for uploading your game. Newgrounds users usually don't comment as much as Kongregate users, but if your game gets a good rating you can be rewarded with TONS of gameplays.
MochiAds
A great way to maximize your earnings from your games is to put MochiAds into them, which runs ads while the game is loading. Then just upload you game to as many random game portals as you can, hope it goes viral, and watch your earnings rise automatically.
Flash Game License
This only works for games of high quality, but if sponsors are impressed with your game they will pay hundreds or thousands of dollars to sponsor it. The best way to earn money professionally from flash games.

The Next Level: Stepping Up Your Game

Congratulations! By now you should be a pretty solid game developer. It's time to kick things up a notch and check out some more advanced concepts so you can make any type of game you desire.

I HIGHLY recommend reading the tutorial below from asgamer.com. It helps you put together a VERY nice vertical shooter game complete with a player controlled ship, bullets, enemies with AI, a HUD, score, and more!

During the 9-part series it introduces the concept of external classes.

Learning to use external classes separates the true devs from the rookies. Basically, by storing your actionscript in separate files that specifically connect to certain game objects you can create new objects in the game with preset actions. That might sound complicated, but think of it like this:

You have a Bullet class. Inside of it you include code that makes it move at a constant velocity and disappear if it touches an enemy.
Now whenever you create a new Bullet in your code, it will automatically move and disappear as we directed. This way, we can create hundreds of bullets without having to individually code each one! Extremely useful.

So please read this next tutorial, it is one of my personal favorites :)

More Advanced Game Programming Tutorials

Here's a substantial list of some good game tutorials to help improve your game programming skills. You should have a good understanding of AS3 before attempting these. Many of these tutorials use external classes to store the actionscript (instead of the main timeline).
Build a Simple Flash Frisbee Game With AS3 | Activetuts+
In terms of a "more advanced" tutorial, this one is super simple.Learn to build a really simple keepy-uppy game. Click the frisbee to send it skyward, then spin it with your mouse to stop it falling to the ground.
Making a Flash game like Plants Vs Zombies - Emanuele Feronato
A series of tutorials that demonstrate how to make a game like the famous PvZ. Written by one of my favorite flash bloggers, Emanuele Feronato.
How to Create a Platform Game in AS3 - Flash Game Tuts
Learn to make a complex platformer game using some advanced concepts. Great tutorial!
AS3 Vertical Space Shooter - ASGamer
In case you didn't see the giant arrow up above -- READ THIS TUTORIAL.

This was probably the most influential series I ever read -- I still structure much of my game code around the principles that I learned from this tutorial 2 years ago. It teaches you to make a vertical space shooter in AS3 with well-structured class-based code. Crucial knowledge for any aspiring AS3 Flash Game Developer.
Create a survival horror game - Emanuele Feronato
Another Emanuele Feronato tutorial. This one shows how to create a top-down horror survival game. Pretty cool result, you should check it out!
Build a Minesweeper Game Within 200 Lines of Code | Activetuts+
In this tutorial we will learn how to plan and code a minesweeper game using AS3 and Flash. Can we make it in just 200 lines?! Let's see...
Create a Flash game like Pixel Purge - Emanuele Feronato
A great tutorial for smooth top-down movement with a scrolling parallax background.
How to Create a Tower Defense Game in AS3 - Flash Game Tuts
Learn to make a Tower Defense game -- one of the most popular genres of all time!
Tile based games
A super cool series that shows how to build a ton of different styles of tile based games. It is pretty difficult to understand everything, but is a valuable resource.
Game Menus, UI, Screens, and Windows- ASGamer.com
Extremely useful tutorial that walks you through building a menu system for your game. You should also read the two other tuts in this series that talk about Preloaders and Preroll Screens.
Build an Intelligent Tic-Tac-Toe Game with AS3 | Activetuts+
Tic-Tac-Toe, that's boring! you might think. In this tutorial I will show you that building a Tic-Tac-Toe game is anything but boring.
Complete Bejeweled game - Emanuele Feronato
The complete sourcecode to a match-3 game. It isn't thoroughly explained, so you'll have to be able to figure it out on your own.
Create Your Own Pseudo 3D Pong Game | Activetuts+
A VERY cool tutorial which transforms a basic pong game into a visual masterpiece.

Want to find these links again later?

Bookmark this page so you don't forget!

Add this to your lens »

Bookmark and Share

Useful books for Flash Game Programming

Loading

AS3 Game Tuts: My Blog

Here are the latest posts from my new flash game tutorial blog: as3gametuts.com
I try to make them as useful as possible. If you enjoyed this page please check them out! Thanks!"
Loading

Thanks for visiting!

Please leave comments! This is my first lens and I spent a long time pouring in everything I know to try to make this the best I possibly could. I'm also planning on creating some more lenses soon on similar subjects, so if you have any questions or suggestions on how I can improve I'd love to hear them!

  • murat May 14, 2012 @ 2:50 pm | delete
    how program 3d games like http://zombiegames4u.blogspot.com/p/blog-page_9073.html in ation script
  • Ashic90 Mar 14, 2012 @ 2:42 pm | delete
    nice work.... very good lens for me ...
  • Daniela Mar 7, 2012 @ 10:53 am | delete
    There are lot of websites where you can embed their games to your website, for example http://www.freegamesonline.eu.com This way you can safe your bandwidth.
  • forstructuredsettlement Feb 20, 2012 @ 6:08 am | delete
    Great Post! i appreciate about this post and would reccommend to others.... I have also good material forsql tutorial for beginners
  • unknown Feb 15, 2012 @ 11:34 am | delete
    Thanks for taking your time on this:)
  • BuddyBink Nov 3, 2011 @ 4:41 pm | delete
    I enjoy working in Flash. I am still at the simple game level but, it is just so much fun!
  • jvillekid Sep 25, 2011 @ 1:44 pm | delete
    Very nice lens. I have always wanted to make my own games, now you have shown me the way!
  • bechand Sep 11, 2011 @ 3:16 pm | delete
    I am glad you put some time into your pages ... I hate the short little ones :O) This was entertaining and interesting
  • TheFoodDigest Sep 4, 2011 @ 7:33 pm | delete
    I'm highly impressed. Keep it up.
  • webcodez Sep 4, 2011 @ 7:06 am | delete
    Great lens! I love to program but never have programmed with actionscript, yet!
  • Load More

by

Benolds

Hey there, I'm Ben! Over the past two years, I've become proficient in programming flash games. Many websites have been invaluable to me on my quest t... more »

Feeling creative? Create a Lens!