Hardware Reference
In-Depth Information
A program is a series of instructions or statements that you type in a particular
programming language, which the computer then follows automatically. You
must use the correct type of instructions for the programming language you are
using. In this topic, you are using the Python programming language.
A statement is a general computing term that usually means one complete
instruction that you give to the computer, e.g. one line of a computer program
such as print("Hello Steve") . Some people also use the word command ,
but that is more relevant when you are talking about commands that you type at
a command prompt to a computer.
Python has its own very precise explanation of what a statement is, but for the
purposes of this topic I will use statement to mean one individual instruction or
line in the Python program. If you want to read more about the Python language,
you can read the online documentation here: https://docs.python.org/2/
Sensing Your Player's Position
Before you can sense your player's position, you need to understand a bit about how
the Minecraft world is organised. Everything in Minecraft is exactly one block in size,
and a block represents a one-metre cube. As your player, Steve, moves around the
Minecraft world, the Minecraft game remembers where he is by a set of coordinates .
The world is constructed of empty blocks that are filled by materials that are usually
one-metre cube in volume. There are a number of exceptions to this, for example car-
pets and liquids such as water and lava that can take up less volume when viewed, but
cannot be combined with other materials to fill less space than a one-metre cube.
By sensing your player's position in the Minecraft world, you can make your game intel-
ligently react as you move around the world, such as displaying messages at specific
locations, automatically building structures as you move around, and changing your
players position when you walk to specific locations. You will learn how to do all of these
things in this topic, and many of them you will learn right here in this adventure!
A coordinate is a set of numbers that uniquely represents a position. In Minecraft,
3D coordinates are used to represent the exact position within the three-dimensional
Minecraft world, and each coordinate consists of three numbers. See also http://
en.wikipedia.org/wiki/Coordinate_system for information about coordinates, and
http://minecraft.gamepedia.com/Coordinates for information about how Minecraft
uses coordinates in the Minecraft world.
 
Search WWH ::




Custom Search