[Minigame] Mouse Maze |
![]() ![]() « Citoyen » 1431880920000
| 0 | ||
This is a minigame in which you have to navigate a maze that is randomly generated while in nightmode. The first mouse to get the cheese and bring it back to the whole wins the round and a new maze loads. Also there is no time limit and the maze will not switch until a mouse can bring back the cheese. Due to random numbers and such some mazes will be easier then others. This is the link to the script on pastebin If you do no want the maze to be in darkness (not as fun), then you can set NIGHTMODE to false in line 1. Here is an example of a maze generated by the script: ![]() When the script loads, you will actually be above the maze until it finishes building. Once the maze is completely built, you will be teleported the hole where you will then have to search for the cheese. The maze generation is based off this "recursive backtracker" algorithm I found on Wikipedia, so I did not come up with it but rather wrote it into Lua, and made it specifically work with Transformice. If you want to the maze algorithm from this script, just copy the entire Maze object and follow this api: First initialize the maze by calling Maze.init(). It can take up to four parameters: seed : the seed for the random number generator -- Defaults to current time when nil cell size : the width and height for each "box" of the maze -- Defaults to 50 when nil width : the number of cells wide the maze is -- Defaults to the max amount of cells that can fit on a standard 800 x 400 map when nil height : the number of cells high the maze is -- Defaults to the max amount of cells that can fit on a standard 800 x 400 map when nil Calling Maze.generate() will create the maze and store it into memory. Maze.startCell (x / y object) and Maze.winCell (x / y object) are updated at this time. They are used to designate the start and end of the maze (note: the x and y are in the number of cells, not pixels. You can use Maze.util.toGlobal( <num> ) to get this value in pixels relative to the map). You can then call Maze.build() to create the wooden platforms. However, this only creates the wooden platforms. It does not delete old ones or add the cheese or hole. These should be taken care of by calling a tfm.exec.newGame(). Also due to me being lazy and not sorting out all the bugs unknown complications, sometimes the map will fail to generate completely or get stuck leaving the mice stranded outside the maze. If that occurs restart the script or leave the room and come back. |
![]() « Citoyen » 1431883800000
| 0 | ||
Seem fun and impossible ! Random generation is sometimes generous \o/ ![]() |
![]() ![]() « Citoyen » 1431891780000
| 0 | ||
Yeah I just discovered that if the cheese and hole spawn super close and you get it back within 3 seconds, it won't let the tfm.exec.newGame() function be called, and so it will generate a new maze on top of the old one and won't cycle. Fixable, but I won't worry about it since the game breaks itself in other ways. |
![]() ![]() « Citoyen » 1431984180000
| 0 | ||
So can we play it like right now. |
![]() ![]() « Consul » 1432172100000
| 0 | ||
Isn't like Labryingt? |
![]() ![]() « Consul » 1432176300000
| 0 | ||
Bugembo a dit : Labyrinth* I can play it now! |
![]() ![]() « Consul » 1432217040000
| 0 | ||
Csonewforyou a dit : The name is hard to remember u.u |
![]() ![]() « Citoyen » 1432324620000
| 0 | ||
Bugembo a dit : Wait is this already a thing in tfm? |
![]() ![]() « Consul » 1432378920000
| 0 | ||
Firestonnne a dit : Gusse so. /module labyrinth |
![]() ![]() « Citoyen » 1432392360000
| 0 | ||
FML modos remove thread |
![]() ![]() « Citoyen » 1432830780000
| 0 | ||
noooooo your version of the game is so much more fun |
0 | ||
Why feel bad about there being another maze game already? This one looks awesome and you even shared the script so it can also be useful for other people willing to learn or modify it. Also #labyrinth uses a totally different concept with the maze changing every 15 seconds. Since we're talking about mazes here, some nice places to learn more about maze algorithms, in case anyone is interested: http://www.jamisbuck.org/presentations/rubyconf2011/index.html http://www.jamisbuck.org/mazes/ From what I've read, recursive backtracker seems to be one of the best and more popular for maze generation. I think the problem with your script lies in how the cheese and hole locations are generated. There should be a better way to do that. |
0 | ||
yeah some times the cheese is blocked or there is no way to get our of hole lol |
![]() ![]() « Censeur » 1460554800000
| 0 | ||
Brâââââânză *-* (24.27s) |