Hardware Reference
In-Depth Information
Using Coordinates in
Minecraft Pi
You can see how easy it is to make something interesting happen in the Minecraft
game environment using Python code. Minecraft gives the appearance of three dimen-
sions. To achieve this, Minecraft Pi uses x, y and z coordinates to generate a 3D envi-
ronment, with x representing forward and back, y representing up and down and z
representing left and right (see Figure 6-4).
FIGURE 6-4 x, y and z coordinates
Finding the Player's Location
To understand coordinates within Minecraft, in this part of the adventure you will
ind out the current coordinates of your player and then transport her to a diferent
location by changing the coordinates. Begin by writing a program to locate your player.
1. In an LXTerminal window, type the following commands to create a new nano
text editor ile called location.py :
cd mcpi/api/python
nano location.py
Search WWH ::




Custom Search