Level Select and results

Game is looking good, I have just added the Level Select, and a results screen.



You might be wondering how can you select levels if the levels are created randomly. To explain this I must first talk about how random numbers are generated.

In order to create the illusion of a random number, imagine a super long list of numbers in no particular order, for the game you just follow that long list of numbers, this might sound really bad, but the truth is that it is very hard to predict in what part of this long list you are currently on.

So in order for the game to be different every time, flash starts at a different position on this long list.

I know this random dilema sounds really bad, but in this case it is great for me, because if all the numbers are the same, then that means if I start at the same place I will get the same results. so that is why there is a level code, this code is basically the item you want to start the random on.

unfortunately flash doesn't let you set the starting number (called the Seed), so in order to do this I got this wonderful code from this page: http://www.actionscript.org/forums/showthread.php3?t=210807

and I was able to create the level select.

No comments:

Post a Comment