On the left: a regular movie clip. On the right: three blitted clones.
“Blitting is a higher-performance alternative to using the built-in display list in Adobe Flash for drawing objects on the Stage. This technique involves copying the individual pixels of an existing image directly on to the screen—a bit like painting all of your game’s spaceships and monsters onto a canvas.”
From a tutorial I wrote for Adobe Developer Connection: Blitting and Caching Movie Clips in Flash.
It’s an introduction to blitting for developers using the Flash authoring environment (Flash IDE); you’ll learn how to take a regular movie clip from the library, cache it as a series of Bitmaps, and draw it (blit it) to the screen.
Why bother? Because to blit an object is much faster than to use addChild().
Click here to start reading. If you’ve got a free Adobe account, you can comment on the article itself; otherwise, feel free to ask any questions in the comments to this post
Optimisation is about making your code more efficient. Usually you’ll optimise for speed — not to make the gameplay faster, necessarily, but to keep the game running smoothly, with no lag.
(If your SWF is a few MB larger than you’d like, you’d want to optimise for size, but that’s a different topic for a different post.)
The hundreds of tricks and techniques to do this boil down to one principle:
Don’t make Flash do more work than it needs to
For example, suppose you have a line like this:
var newX:Number = ( 47 * Math.sin( Math.PI * 23 / 109 ) / 121.88 ) + player.x;
…and you run that line every tick or every frame. Look at all the work you’re making Flash do!
It’s got to get the value of pi and multiply it by 23, then divide that by 109, then get the sine of that number, then multiply that by 47, then divide it all by 121.88, and finally add the player’s x-position.
If you grab your calculator, you can find that 47 * Math.sin( Math.PI * 23 / 109 ) / 121.88 is 0.237317256. That’s not going to change; we don’t need to make Flash keep calculating that over and over again. So that line can be rewritten:
var newX:Number = 0.237317256 + player.x;
Suddenly, Flash has much less work to do — you’ve done the work for it.
Let’s look at some better examples…
[click to read on…]

Why Use Version Control?
Do any of these sound familiar?
- You have a bunch of different folders called MyGame, MyGame-backup, MyGame-February, MyGame-finished, MyGame-bugFix, MyGame-Mochi, MyGame-Kong, …
- You avoid deleting code in case you need it later, so you’ve got lines and lines of commented-out ActionScript, just in case
- You’re reluctant to experiment with new code in case you screw something up and can’t undo it later
Version control helps with all that. It keeps track of all the changes you make and lets you move back and forth through all the different versions of your project, even if the differences between versions are only tiny. It also allows you to split off separate “branches” of your project and work on them alongside your main code, which is really useful if you need to make different versions of a game for different portals or sponsors.
If you collaborate on code with other people, then you already know how messy it can be trying to copy and paste each other’s changes to keep everyone in sync. Version control helps here too, by merging everyone’s changes together. OK, sure, if two people try to edit the same function at once, there’ll be problems — but at least this can be detected and dealt with quickly.
Once you get used to using version control (also known as source control or revision control), you’ll find other benefits appear. For example, simply getting into the habit of noting down all your changes (as VC requires you to do) can make you more productive, and encourage you to be more organised when tackling problems.
Right. So VC is great, no arguments there. If you’d like to know more about what it is, check out this excellent post over at BetterExplained. In this tutorial, I’ll show you how to get started using Git as a version control system for your Flash projects.
[click to read on…]