Hardware Reference
In-Depth Information
Positioning the Player
Finally, let's place the player at the random position where you started generating the maze.
You could put the player anywhere, but this seems as good a place as any, and it uses random
numbers you have already generated:
mc.player.setTilePos(realx(playerx), GROUND+1, realz(playerz))
Now you're ready to play! Figure 7-4 shows the maze from the inside.
Figure 7-4:
Finding your
way around
the maze.
The Final Code
Listing 7-1 shows the inal and complete code.
Listing 7-1 The Minecraft Maze Maker
#!/usr/bin/env python
"""
Minecraft Maze Maker
By Sean McManus
From Raspberry Pi Projects
Search WWH ::




Custom Search