Saturday, 3 December 2011

Actionscript communities

Some places where you can discuss ActionScript, especially for game development

Friday, 2 December 2011

The Bitfield class

This is a simple class I made to handle bitfields in ActionScript. It's main purpose is to make it easy to save flags for preference and progress as integers, alongside other integers so simplifying the code for loading and saving which was tricky to debug.

It includes methods to access individual bits and the whole data as an integer for saving. I also added a function to sum the number of bits, to count the number of awards as they were stored in a Bitfield.

Thursday, 1 December 2011

The JIT compiler and constructors

One of the biggest optimisations I did to Bug Tunnel Defense was also the easiest.

ActionScript 3 includes a number of improvements to the language, but perhaps more significantly includes a new runtime, AVM2, which incudes a just in time (JIT) compiler. This speeds up all code significantly but with one notable omission. It doesn't speed up constructors.

Wednesday, 30 November 2011

Less is More

(originally posted 11 June 2011)
While making Bug Tunnel Defense I had many ideas which didn’t make it into the final game. Some didn’t make it off the drawing board but some got as far as being implemented before being removed.

Monday, 28 November 2011

Distance check

Distance calculations are important in many games. One important example is checking distances to compare them to the range of a weapon or weapons; turrets placed by the player or AI enemies that need to decide when to fire. And because there can be many enemies or turrets in game these calculations may need to be done very often, perhaps many times a frame.