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/
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;
};
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);
}