Hardware Reference
In-Depth Information
FIGURES.8-6 Alien spaceship block positions
The alien spaceship shows you how you can create three-dimensional shapes
using the MinecraftShape object. The shapes can be as big or small, and as
simple or complex as you like. This gives you lots of different options for using
shapes in your Minecraft programs.
Like the block friend program, the code for the alien invasion will be in two parts. The
first part is the rules to decide what the spaceship will do next; the second part is the
code that moves the alien spaceship toward the player.
When the alien spaceship is chasing the player, it will taunt him by posting messages
(like “you can't run forever”) to the chat. The messages are picked at random from a list
of taunts (see Figure 8-7).
The rules to decide what the alien spaceship will do next will be based on one of three
modes:
Landing: When the program starts, this will be the spaceship's initial mode and
it will come down from sky directly above the player.
Attack: As soon as the spaceship lands, it starts to attack, constantly chasing
the player until it is directly above the him, from where it will “beam” the him
inside.
Search WWH ::




Custom Search