Righto my effort is done.
Except now I’m burgering around with github, but I have finished now I promise! Just struggling to get the rest in.
The source is here: https://github.com/Rakoonic/A-MAZE-ingly-bad-game
I finished about 15 minutes before the deadline, and I have to thank the IRC crew and particularly Tyraziel for motivating me.
With this: http://www.quickmeme.com/meme/3vlkoc/
And this: http://www.quickmeme.com/meme/3vlkqo/
And this: http://www.quickmeme.com/meme/3vlkoz/
Screenshots:
So what is the game?
You control the purple block on the left with the buttons and must collect the green block on the right on each level.
There are 10 mazes, and each maze gets progressively bigger as you go along.
The goal of the game:
You need to complete all 10 mazes in as few movements as possible.
Why is that hard?
Because I dunno exactly how many movements that is.
Each maze is generated by an algorithm based on how many moves you used in the past.
So what this means is it may be more efficient to add an extra move or two in some mazes, to give you slightly easier mazes later on.
Does this work?
I have absolutely no clue, but it should in theory!
Is there anything actually cool in the game?
Well, I’m quite happy with the maze generation code. It is in theory possible to be blocked in at the start (if 3 solid walls are generated around where you start. I’ve never seen it happen, and I’ve kept the solid blocks down to prevent this. If it happens, consider that you have lost the game and need to try again.
The maze and collision code it generates can be used by pretty much anyone with ease.
You supply a start point, an end point, and a few parameters and it fills the remaining space with the paths.
Parameters are ‘bias’ (how likely the path is to go straight on rather than turn - the bias value is simply how many times I repeat the same direction compared to the alternatives, and then randomly pick from one of them so bias 0 = no bias, and higher values equal longer and straighter path mazes.
The other parameter is percentageFilled (an incredibly inaccurate name now I think about it) which specifies how many blocks are initialised as ‘solid’ in the map, and routes cannot pass into them. They are picked at random, and the algorithm might be able to pick the same block more than once, hence why percentage in the name is false, it is more down to how many times I pick spots to fill in.
Have you actually completed it yourself.
Yes. 1104 steps. Slightly irrelevant now, knowing that the levels aren’t consistant across platforms
Are there any issues?
Yes - I am concerned that the random number generator does not produce the same results across different platforms. An upgrade would be to include an extremely large table of pre-computed values that I use as a ‘random’ look-up so I can guarantee that the seed values and random numbers generated from them are the same across platforms. People also might get fairly frustrated having to repeatedly touch the buttons rather than just holding them down to move in a single direction. Sorry about that. It may be possible to cause problems with the randomseed as I end up with really big numbers for the seeds in the last level.
Are there any bugs?
Yes - the random seed thing as stated above.