Friday 23 December 2011

Flash Game License

Last week I wrote about wonderfl, a unique resource for Flash developers. But it's not one I use a lot; I've perhaps used it only a few times for experiments and for code I'd like to show working.

By far the most important and useful web site I use is Flash Game License. As it says below its logo it is "The place to buy and sell Flash games.", so it's a marketplace. It's needed because of the structure of the Flash game industry, with many buyers and even more sellers, of games worth so little that they are not worth advertising or heavy promotion.

Thursday 22 December 2011

Bug Tunnel Defense: Levels

(originally posted 6 June 2011)
The missions in Bug Tunnel Defense started out a lines of code, describing the position and location of every wall, tunnel, entrance and exit. This became unwieldy very fast, and it was clear it would be unusable for the dozens of missions I wanted in the final game.

Wednesday 21 December 2011

SharedObject file location

One thing that comes up from time to time, that I learned while making Bug Tunnel Defense, is how to control where Flash saves the settings for the game (assuming the game has settings). This is important as the default location depends on the path to the file on the server and the name of the file on the sever. Although this doesn't usually change it can when the file is moved as it's re-uploaded or for security reasons.

Tuesday 20 December 2011

String to ByteArray

In Bug Tunnel Defense all levels (called missions in-game) are stored as Strings. This includes the built in levels, levels stored on the user's machine that they've created, and levels stored online in GamerSafe's LevelVault and Kongregate's shared content system. Kongregate also uses Strings, so was very straightforward. But LevelVault requires data stored in a ByteArray, so I needed to convert Strings to ByteArray.

Monday 19 December 2011

More matrices

Last week I wrote about one way to use matrices, passing values to the Matrix constructor to make a transform or scale matrix. Matrices made this way can be passed to functions that need them, minimising the number of lines and temporary variables. This approach is fine for simple uses but breaks down for more complex applications, as the values passed to the constructor require multiple calculation steps, too much to do inline. Fortunately there is another, easier, way.