Tuesday, December 14, 2004

Aquent Snowball Showdown

Just finished working on the Aquent London(UK) Christmas web game, I'm feeling a bit frazzled, maybe because I've been detoxing from caffeine, (excessive) sugar, alchohol and nicotine for the last two weeks as well... (hmmm... now that I see that in print it scares me a bit.) - or maybe the lack of sleep and stress inherent in coding a game for a christmas deadline? Started and finished this week, took 61hrs+. (ouch)

It's a "whack the mole" / "duck shoot" style game, it's a fun way to waste your time... Go on, play it...

Update! - The game is no longer collecting emails, you can skip the email form by typing SKIPFORME in the firstname field... (I'll be taking the forms away soon as I get a chance)

http://www.mentalaxis.com/snowball/

Saturday, December 11, 2004

Actionscript - prototype makeXMLSA 1.0

I always assume everyone out in Flash land is well aware of the wonderful site prototype which is a growing library of functions and classes (both AS1.0 and AS2.0) that's been running since 2001. I posted an XML -> Object conversion method known as XML.makeObj() last year and I have recently noticed some very active work by Max Ziebel (Maxomatic) to extend the method, this has resulted in a new method makeXMLSA 1.0... Great work.

SQL and CSS quick reference...

A good while ago when I was actively maintaining my old website at http://mentalbloc.net I made these quick reference guides for CSS and SQL, they're pretty useful really, I'll be updating the SQL shortly so that there is more useful help for INSERT, SELECT, UPDATE etc... since I didn't really show many examples in the original version...
  • SQL Quick Reference
  • CSS Quick Reference
  • ActionScript - function randomRange()

    A very basic function to provide a random number between two values... Not exactly innovative but anyway here it is...
    /***************************************
    * @description generate a random number
    * from a range
    *
    * @params  from, start of range
    * @params  to, end of range
    * @params  integer, return an integer?
    * @returns random num in range
    */
    
    function randomRange
    (
        from:Number, 
        to:Number, 
        integer:Boolean
    ) : Number
    {
        var range:Number = to - from;
         if(integer)
        {
            var randomNumber:Number = Math.round
            (
                 Math.random()*range
            );
        }
        else
        {
            var randomNumber:Number = Math.random()*range;
        }
        randomNumber += from;
        return randomNumber;
    };
    

    Friday, December 10, 2004

    Azureus 2.2.0.0 CPU Hogging

    If you are using Azureus (v2.2.0.0), one of the best BitTorret clients out there, you may have noticed that your machine is acting up? There's an unfortunate bug that only happens if you've upgraded to Java JRE1.5 too. Something Azureus is doing causes JRE 1.5 to consume CPU cycles and memory, in a similar way to a worm, that said I had a few hours wondering what the hell was happening and it turned out to be the combination of these two. I rolled back to 2.1.0.4 and everything is ok again. Thought someone would like to know. (There is a bug report on Azureus sourceforge.net page)

    ActionScript - function flipIndex()

    This is a helpful function to flip an array index, as opposed to using Array.reverse. I've updated this to as I completely overlooked the simple solution before, also changed the documentation to NaturalDocs format. Plus I'd rather not look like a complete idiot ;).
    /*
    * Description:
    * Flip an array index.
    *
    * Parameters:
    * index - index to flip
    * length - length of array
    * 
    * Return:
    * flipped index (Number)
    *
    * Version:
    * 13 March 2005
    */
    
    function flipIndex (indexToFlip:Number, rangeLength:Number) : Number
    {
        return (length - index);
    }
    

    Thursday, December 09, 2004

    First Post

    Welcome to mentalaxis.com/blog ... I've been in the midst of a quandry... Do I create my own publishing engine... or do I use MoveableType/Blogger etc... When it comes down to it, time doesn't really permit me to write the CMS I want, (I'm very demanding see) no matter how much I want to do it. So instead I've gone for Blogger, it's was a simple choice, in the end it came down to wanting to post a comment on another blog... FLAmous in New Zealand ... it seems, due to all the comment spamming that's be going on (don't you hate that! grr) Blogger.com has a cool feature where only registered blogger users can post comments... So I signed up and the mentalaxis/blog is born. (finally)