Latest Posts

  • Infinite Ammo 4k Source Code Released

    Infinite Ammo 4k

    Well everyone else seems to be blogging about the release of their 4k games, so I’m doing so too :) I managed to get mine finished and submitted on-time. I don’t expect it to win a thing (results are in 3 days time), but I had great fun participating all the same.

    I have created a games page entry for it, and in a slightly unusual move for me I have released the full source code for the game too. You can get it from it’s games page. What you learn from it I have no idea. At the very least there’s a pretty explosion / particle system, and a massively optimised and compressed Tween engine! Or you could just skim down through the code, shaking your head thinking “and he ENJOYED coding this?!” :)

  • AS3 Flash 10 Firefox Search Plugin

    AS3 Flash 10 Search PluginI don’t know about you, but I rely on the Search box built into Firefox a lot. I use it almost religiously and have a selection of search engines in there, one of which is of course the ActionScript 3 Reference.

    It was bugging me that there was no search engine plugin specifically for the Flash 10 version of the docs.

    So, I created one.

    If you use Firefox (or any browser that supports the OpenSearch plugin format) then you can add the Flash 10 search plugin to by simply going to this page on the MozDev site: http://mycroft.mozdev.org/search-engines.html?name=flash+10 and adding the Flash 10 version I created.

    I’ve already used it several times in the past hour, so figured it’d be worth posting about incase anyone else found it useful.

  • How do you extract a Sprite back out of a ByteArray?

    I should probably post this into some AS forums (and will do so later), but I had to get this out there quickly and it’s bugging the hell out of me:

    In short, how do you extract a Sprite from a ByteArray? (or any kind of display object for that matter).

    I can write the object just fine, and read it back into a variable, but I’ll be blown if I can then convert that back into what it was originally.

    Here are my attempts so far:

    [as]
    var test:Sprite = new Sprite();
    test.graphics.beginFill(0xff0000);
    test.graphics.drawRect(0,0,64,64);
    test.graphics.endFill();

    //addChild(test); // to test, works fine

    var b:ByteArray = new ByteArray();

    trace(b.length);    //    0 bytes

    b.writeObject(test);

    trace(b.length);    //    754 bytes, so our Sprite is definitely in there

    //    Reset the pointer
    b.position = 0;

    trace(b.position);    //    0 as I’d expect

    var newTest:Sprite;
    //newTest = b.readObject() as Sprite;    //    Ends up being null
    //newTest = Sprite(b.readObject());    // Type Coercion failed error
    //trace(newTest);
    //addChild(newTest);    //    and kaboom, constant “Parameter child must be non-null.” errors :(

    var take2:Object = b.readObject();
    trace(take2);    // ok take2 contains an object, but how can I get the Sprite out of it?

    trace(b.position);    //    754, so it has definitely read it all
    [/as]

    Ummm someone, please help? :)

  • Žene Kese

    The latest and only album soon available

  • (Spoiler!) Play test my 4kb Game Competition entry

    My 4kb Game Competition entry is very nearly finished. I’m in the final “tweaking” stages, trying to get the last few small bugs out, and iron the gameplay a little so it’s less “random” and even more progressive.

    The game is a twitch shooter based (loosley!) on Geometry Wars and requires some pretty mad flying skillz to last more than 30 seconds. The idea is literally to see what kind of score you can get. Here’s a screenie:

    Infinite Ammo

    There are 10 different baddies, “boss waves”, bullet power-ups and particle explosion effects galore! (I went a bit over the top in all honesty). I’d love to have added sound, but I’m pushed to the limit of my 4096 bytes shackles already.

    I know the game isn’t quite as “playable” as it should be, and I’ll work on that in the final few days left before I need to submit to the contest. I also know I don’t have a chance of winning (having seen some of the other entries lined-up!), but it was bloody great fun to code anyway.

    And so as a sneak peak to you here’s the latest beta to play. Comments welcome (but please do bear in mind this whole game had to fit into 4096 bytes, so don’t go requesting anything insane ok?!)

More posts to tickle your grey matter ...