Author Archive

  • NetStream bytesTotal weirdness

    While working on a custom video player project today I noticed a strange anomoly with the bytesTotal value returned by a NetStream object loading data from a local cache.

    The first time you play a remote FLV via NetStream the bytesTotal result is correct, it’s the size of the file as sent by the server. However once the FLV is in the users local cache, and the SWF was reloaded, the bytesTotal value was reporting a size of 4 GB exactly until the stream had “settled down”, and then it returned the correct value. This seemed to take a second or so at most, but it still meant that my code needed changing to cope with it.

    After making the connection I was storing the bytesTotal value in a uint. An event based check was comparing this uint with the bytesLoaded value waiting for them to equal each other (i.e. get to 100% downloaded). Of course this would never happen, because it was waiting for 4GB worth of data to download.

    So rather than assigning the value to a variable I’m now simply comparing bytesTotal directly with bytesLoaded and then setting a Boolean if they match (downloadComplete = true) to avoid future comparisons.

    Even so, it was an interesting oddity I thought worth reminding myself of in the future. Hence this blog entry ๐Ÿ™‚

  • Enhanced KeyPoll Class Released

    I’ve been using the excellent KeyPoll class by Richard Lord / Big Room Ventures. It’s an extremely fast and efficient class for detecting keyboard presses for your games. But I needed the class to do more, so I’ve extended it, added in some new functionality and released it. My new version can detect multiple key presses at once, has the full scancode const list built-in and adds a new function to return the last pressed scancode. Plus it’s still just as fast and flexible as the original.

    Grab the download and examples after the jump.
    Read More

  • Five Dice Frenzy Beta

    I’ve released a beta of Five Dice Frenzy. It’s very nearly finished. The “instructions” suck, and need to be better integrated to the game (because if you don’t really know Yahtzee, then you won’t really understand how to play this!). I’ve also got some more special effects to add when combos happen (shows of stars, etc). On game over I want to explode the dice too ๐Ÿ™‚

    But even so – give it a play and let me know what you think! The game is embedded into this post just after the jump.

    Read More

  • Playing with Flint

    Damn I love messing with Flint – it is one seriously cool particle system ๐Ÿ™‚ This is a little test I threw together tonight in about half an hour (includes creating the planet image!). Leave it for a few seconds to see the planet trail burn up, and then just click anywhere you want to re-position the gravity well!

    [swfobj src=”http://sandbox.photonstorm.com/planet1.swf” width=”640″ height=”480″]

    Code wise it’s extremely simple:

    Read More

  • OEcake (2D Octave Engine fluids sandbox demo)

    Ok so you need a seriously monster PC to run this – but, bloody hell – just LOOK at it!

    Maybe one day in Flash.. ๐Ÿ™‚

    PC and Mac download from here if you feel so inclined:
    http://www.octaveengine.com/casual/dltrial.html