Hardware Reference
In-Depth Information
Listing 7-1 continued
else: # do this when there are no unvisited neighbours
retrace = cellsVisitedList.pop()
xposition = retrace[0]
zposition = retrace[1]
showMaker(xposition, zposition)
if CEILING == True:
mc.setBlocks(MAZE_X, GROUND+HEIGHT+1, MAZE_Z, ;
MAZE_X+(SIZE*2), GROUND+HEIGHT+1, MAZE_Z+(SIZE*2), 20)
mc.postToChat("Your maze is ready!")
mc.postToChat("Happy exploring!")
mc.player.setTilePos(realx(playerx), GROUND+1, realz(playerz))
Over to You
When the maze is built, the gold brick is left showing, so you could try to solve the maze to
ind the brick. You could also plant other objectives in the maze, and time how long it takes
the player to ind them. he mc.player.getTilePos() command checks where the
player is in the Minecraft world, and gives you a result in the form x , y , z . Code to create a
timer can be found in Chapter 9, “Test Your Reactions”.
You could add an entrance and exit in a random position in the border of the maze, so the
goal is to travel from one side to the other. You could make huge mazes more playable by
adding landmarks. (Try using diferent wall materials, or putting blocks on top of some
walls.) After the maze has been generated, you could knock out random walls, so there are
some shortcuts through the maze. Or maybe just replace them with glass blocks, to provide
a tantalising glimpse into another corridor. What about a multistorey maze, with stairs
between the levels? he possibilities are . . . ahem! . . . amazing.
Search WWH ::




Custom Search