How to make Flash games

148 posts

Flag Post

How do I make games for Kongregate?

While there are lots of tools and languages that allow you to make games, the ones uploaded to Kongregate are either Flash or Unity3d games. This guide is about Flash, which offers comparable 3D performance and quality to Unity.

To upload a Flash game to Kongregate, you need to be able to compile .swf files.


What is a .swf file?

SWF is a file format for multimedia, vector graphics and ActionScript.

Files using the SWF extension are media files that require the Adobe Flash plug-in to render. SWF files are used for a variety of applications — from video embedding to entire websites — and can create dynamic, visually rich media to create an interactive environment. According to Adobe, approximately 99 percent of Internet users have Flash installed and enabled on their browser, making it one of the most widely adopted Internet technologies.1


Where can I get these SWF files?

You make them. You do not get them from other sites, as that is stealing. See the Uploading section in the FAQ for more info.


What software do I need?

You need a text editor and a compiler in order to make a SWF file; there are different IDEs which allow you to do this.

Most flash developers use one of the following:

  • FlashDevelop ( Official Site | Download)
    • FlashDevelop is free to download an use.
    • FlashDevelop is focused on the coding aspect. Its text editor includes many features that make the developer’s life easier by showing you hints, bracket-pairs and even allowing you to customize the font color of the different parts of your script.
    • When using FlashDevelop, you’ll have to import your graphics and other media via code (it takes a single line to do so).
    • It’s also worth mentioning that FlashDevelop compiles faster, but it’s Windows-only (can be run in Linux or OSX via a virtual machine).
  • Adobe Flash Professional CS ( 30-day Trial | Students Edition | Purchase Flash CS 6.0 )
    • The current version of Adobe Flash (CS 6.0) costs around $700 USD.
    • The Student Edition can save up to 80% of the price, but with limitations included on the purchase page
    • Adobe Flash, being animation software, includes a graphic editor, allowing you to draw and edit your pics and add them to your project with a couple of clicks.
    • It also allows you to easily create, edit and export animations without requiring external software.

Both options are good and will give you the necessary tools to make Flash games. The choice is yours.


Related Files: .fla, .as3proj and .as

  • .fla
    • This is the file format of the Flash projects created with the Adobe Flash software. These files will open your project, which includes graphics, sounds, animation instructions, frames (if you’re using them), etc. FLA files are opened and edited with Adobe Flash.
  • .as3proj
    • This file is the FlashDevelop version of the FLA file. It saves the location of your library, the current files of your project and includes autogenerated JavaScript and HTML files to test or embed your game in web browsers. AS3PROJ files are opened and edited with FlashDevelop.
  • .as
    • These are files that store the script code of your ActionScript classes, which are used to keep your code organized, among other things.These files can be opened and edited with any text editor (Notepad++, etc), including the FlashDevelop and Adobe Flash ones.

Remember that these files are used to edit your game, but you can’t upload them to Kongregate. To submit a game, you must compile your project and upload the resulting SWF file.


What code do I need to learn to make a Flash game?

You need to learn a coding language called ActionScript. The latest, currently supported and most powerful version is ActionScript 3.0 or AS3. Another option is Haxe, an open source language that can target multiple platforms and devices, including Flash..

An alternative to learning to code would be to use software similar to Stencyl. This thread is intended to cover the programming aspects of making a game. You should visit the Stencyl Forum or Stencyl Website to learn more.


Tutorials And Reference: Where do I learn ActionScript 3?

Michael James Williams’ Avoider tutorial is a good place to start. It covers all the basic elements of ActionScript 3 and explains the code, so you know what you’re doing instead of simply copy-pasting someone else’s game.

The FlashDevelop tutorial will help you if you are using FlashDevelop, as it’s focused to it. Note that it’s not finished (and may never be), but it covers the basic aspects of FlashDevelop (installing and configuring the IDE, using the embed metatag).

The AS3 Language and Components Reference should be immediately bookmarked, as you’ll be checking it every 5 minutes while you start learning.

More programming related tutorials can be found in the Flash Game Tutorials Thread >>



Debugging: My code isn’t working ):

Once you start making games, there will be times when you find yourself struggling to make some code to work properly. If you have any questions, feel free to make a new thread on the forums and other developers will gladly help you. Just make sure to give a proper formatting to your posts if they include code.

You can also visit the Game Development Room where you’ll be able to chat with other developers and try to find a solution to any problems you may have.


Is there a “Flash Game Maker” to easily create Flash games?

If you think programming is challenging, visit the Stencyl forums and read the stickies. Stencyl allows you to make Flash games without having to write code. Note that Stencyl games can have bad performance and not using code will greatly reduce what you can do with your game.


Additional Tools & Frameworks (free/open source):

Flixel: A free collection of AS3 files to help you organize, improve and optimize your games.

FlashPunk: An AS3 library focused on 2D bitmap graphics: animation, collision detection, motion tweens, etc.

Citrus Engine: Another library. Includes a sound manager, particles system and premade objects, among others.

Pixelizer: Pixelizer is a component based framework for writing games in AS3. It is easily extendable and reusable, plus it uses blitting to render the graphics.

GiTD Template: An AS3 template for the GiTD contest.

 
Flag Post

To do:


 
Flag Post

Add Stencyl, Sothink, and SwishMax, plus a brief note about AS2 basics (because many many new devs still start with it no matter what anyone says). Links to the API docs and a note about the diff between AS2 and 3 Kong APIs might be useful too. APart fromn that, good update for the thread, sticky it, etc etc.

 
Flag Post

the FlashDevelop installer actually installs the latest release of Flex for you. you don’t need to include both links.
what we need to do is desticky the current thread and create a new one (not this one) to replace it, so that all of the questions and advice that are 3-4 years old aren’t read

also, it took just under two years to get my code formatting thread stickied

 
Flag Post

Added AS2 info and removed Flex link.
About Stencyl, Sothink and Swish Max, I’ve never used them. Care to make a little review of them?

And yeah, this isn’t meant to be stickied (at least not yet)… the idea is to get suggestions and build it step by step.

 
Flag Post

don’t forget to mention flixel

 
Flag Post

Your gamemaker section mentions director, which you took out before.
I really don’t think Stencyl needs to be included currently.

I think it could also use some formatting work.

Also, What is a swf file could be answered much better (and should be What is an swf file?).

Might as well link the product logos if that’s possible in the forums.

 
Flag Post

don’t forget about unity. i just realized that was missing entirely

 
Flag Post
Originally posted by BobTheCoolGuy:

Your gamemaker section mentions director, which you took out before.
I really don’t think Sothink needs to be included, or stencyl currently. Never heard of swishmax.

Why not? For the typical new programmer, who can’t afford $700 for Adobe Flash, and doesn’t want a code-only compiler, they’re probably much more useful than the programs listed.

 
Flag Post
Originally posted by BobTheCoolGuy:

Stencyl is still in Beta and sothink doesn’t make games

We talking about the same thing? http://www.sothink.com/product/swfquicker/

Bob deleted that post, but this reply lives on to shame him.

 
Flag Post

I never got sothink to work.

 
Flag Post

Removed the Director part.
I’m logging out. I’ll edit tomorrow.

If you want to add something, just write it down and I’ll add it. Regarding Unity, do you think it’d be fine to keep it on the same thread or to make another thread for it?

 
Flag Post

Maybe mention Flixel? I feel like it’s a really good companion to FlashDevelop for those that don’t want to buy Flash!

 
Flag Post
Originally posted by qwerber:

don’t forget to mention flixel

 
Flag Post
Originally posted by qwerber:

I never got sothink to work.

For about 6 months I used SoThink. Add it because it is very cheap and is pretty decent software for actionscript.

 
Flag Post

Added some more info to the What is an .swf file? section.

Care to write something about Stencyl, SoThink and Swish Max?
I’ve never used them.

 
Flag Post

Very nice Senekis. But typo: Game Developement Room.

 
Flag Post

possibly explain the difference between .swf, .as, .fla, etc. files

Also, someone please sticky this. It’s definitely superior to our other outdated one.

Good job Senekis.

 
Flag Post

Fixed typo and added info about the other file extensions.

 
Flag Post

possibly explain the difference between .swf, .as, .fla, etc. files

I don’t think that’s necessary, it should be covered in the tutorials that are linked to. Adding too much information is just going to clutter the page up.

Personally, I would just call it Adobe Flash rather the Flash CS 5.5. Including the version number means that this is going to look outdated in 6 months time when the next CS is released.

Possibly controversial, I don’t see the point of mentioning AS1 or AS2.

 
Flag Post
Originally posted by truefire:

possibly explain the difference between .swf, .as, .fla, etc. files

It’d be a better idea to explain the difference between classes and objects, IMO.

 
Flag Post

It’d be a better idea to explain the difference between classes and objects, IMO.

Again, not really necessary. I think it better that the FAQ just linked to tutorials than almost become a tutorial itself.

 
Flag Post
Originally posted by Doreen1954:

Again, not really necessary. I think it better that the FAQ just linked to tutorials than almost become a tutorial itself.

he wasn’t being serious, but instead making a joke relating to the dozen or so threads we’ve had recently where people don’t know the difference.
i believe a new tutorial was published recently, and that’s where problems are coming from.

 
Flag Post
Originally posted by Senekis93:

Added some more info to the What is an .swf file? section.

Care to write something about Stencyl, SoThink and Swish Max?
I’ve never used them.

SoThink is an SWF decompiler. Turns swf files into fla flex or allows you to export code or resouces. Its good for reverse engineering and as a learning tool, but id prefer ActionScript viewer 2011 for this.

No idea on Swish Max

Stencyl is a website that allows you to make cookie cutter games. Kids stuff to be honest. The code is all compiled in AS2. I really wouldnt waste my time.

 
Flag Post
Originally posted by FlashGrenade:

SoThink is an SWF decompiler. Turns swf files into fla flex or allows you to export code or resouces. Its good for reverse engineering and as a learning tool, but id prefer ActionScript viewer 2011 for this.

there’s also SoThink SWFQuicker