Saturday, February 16, 2008

My code runs impossibly fast!?!?

I recently posted my code so far on the actionscript.org forums in case anyone else attempting to make a tile-based game like this may find it useful.

It seems however after a post today by friendly forumite "sgartner" that my code shouldn't possibly be able to run as fast as it is! Here's the post:

http://www.actionscript.org/forums/showthread.php3?t=160386

So basically, because I happened to make my code with the split() function it seems to have made the arrays faster to access than if I had created them in any other way!

I hope that I've discovered some unbelievable flaw in actionscript that will make peoples code run faster, and that it's not just a (unlikely) coding error in the changed examples by sgartner!

This should turn out to be extremely interesting, and I want to find out if it will have the same effect with single, linear arrays or if it is limited to multi-dimensional arrays as I have used.

2 comments:

Gav Cooper said...

what does dropping the frame rate right down do? sorry if it's a silly thing to ask but I thought it would be the obviouse fix. I don't fully understand your code though so it might do bugger all...

Adam said...

changing the frame rate just slows down the refresh rate (and also how fast it moves as it moves a certain amount per frame!).. other than that it has no effect