Posts tagged as 'Free code'
Object Pool class
Two of the slow operations in the flash player are object creation and garbage collection. If we pool objects – save objects when they’re no longer needed and reuse them later when another object of the same type is required – then object creation is kept to a minimum and garbage collection is reduced to zero…
Posted on 8 October 2008 | 11 comments | continue reading
Actionscript 3 tetris source code
This will certainly be useful to anyone wanting to make a tetris game. It’s probably also useful to anyone learning Actionscript 3, particularly if they want to make games. The source code is on the Flash Game Code web site. It’s in two parts – an engine, which does the game...Posted on 13 December 2007 | 7 comments | continue reading
Radial Perlin Noise
I was messing around with perlin noise, creating a radial effect for a game I’m working on. The result is a RadialPerlin class for creating radial perlin noise bitmaps. The code is licenced under the MIT license. Have fun, and if you make something interesting with it let me know.
Posted on 29 October 2007 | 3 comments | continue reading
PHP Password Security
If you build websites that require users to register it’s your responsibility to keep their passwords safe. And if you’re storing the passwords in plain text then you’re not doing your job properly. What happens if your database is stolen? It’s not just your site that is compromised. Since most users use the same password on multiple sites, all those sites have also...
Posted on 10 October 2007 | 29 comments | continue reading
Keyboard polling class – bug fix
There was an error in the Keyboard polling class that I posted yesterday. If you downloaded the class you’ll want the new version, which is available here.
Posted on 4 September 2007 | no comments | continue reading
Polling the keyboard in Actionscript 3
Games often need to get the current state of various keys in order to respond to user input. This is not the same as responding to key down and key up events, but is rather a case of discovering if a particular key is currently pressed.
In Actionscript 2 this was a simple matter of calling Key.isDown() with the appropriate key code. But in Actionscript 3 Key.isDown no longer exists...
Posted on 3 September 2007 | no comments | continue reading
Events in Actionscript 3
There was lots of positive feedback to yesterday’s post about my Actionscript 2 event class, so I decided to create an Actionscript 3 version. I added a lot of features while I was at it – listener priorities, preventDefault, stopNotification (aka stopImmediatePropagation), hasListeners, weak references, and to send the event as the...
Posted on 15 August 2007 | 1 comment | continue reading
Different types of weak references
Actionscript 3 seems to have two different types of weak references. The difference relates to method closures (or bound methods) and the weak references used by the EventDispatcher and Dictionary classes. Try the following…
Posted on 15 August 2007 | no comments | continue reading