Raspberry Pi By Example
上QQ阅读APP看书,第一时间看更新

Playing Minecraft Pi

Minecraft Pi comes preinstalled in the latest version of Raspbian. So, there is no need for an additional installation. Minecraft Pi can be found by navigating to Menu | Games. Alternatively, we can start it by typing minecraft-pi in lxterminal. The following screen will appear once we start the game:

Playing Minecraft Pi

Click on the Start Game button. Then, the following window will appear:

Playing Minecraft Pi

Click on Create New and it will start generating a new world for the gameplay:

Playing Minecraft Pi

Once the new world for the gameplay is generated, the player character is placed in the virtual world. The default view in the game is the first-person view. It will look as follows:

Playing Minecraft Pi

Note

In Minecraft Pi, a new world is randomly generated in a procedural manner. This means that the world is randomly created with the algorithm rather than using predetermined components. So, no two worlds in Minecraft Pi will be the same. You can learn more about procedural generation from https://en.wikipedia.org/wiki/Procedural_generation.

We can switch from the first-person view to the third-person view by pressing the Esc key or by clicking on the following button for a view change:

Playing Minecraft Pi

Once this button is clicked on, it will change to the following button:

Playing Minecraft Pi

At this point, once we return to the game by pressing the Esc key or clicking on the Back to game button, we will see our Minecraft Pi character in the third person, as follows:

Playing Minecraft Pi

We can change this view to the first person view again by following the preceding steps.

Movement control in Minecraft Pi

We can use a mouse to look around and also make use of the following keys for the movement:

Like most first/third-person games, movement is controlled by WSAD keys on the keyboard. The character jumps if spacebar is pressed once. If we hit spacebar twice, the character is lifted in the air, as shown in the following screenshot:

Movement control in Minecraft Pi

At this point, WSAD keys can be used to fly in the air. We can increase the altitude by pressing spacebar while flying. The following screenshot shows the game world view from a higher altitude:

Movement control in Minecraft Pi

If spacebar is pressed twice while flying, then the character will fall on the ground. While the character is falling, if we press spacebar twice, it will stop falling.

Action control in Minecraft Pi

By default, the player character starts with a sword in hand. If we right-click with the sword in hand, it will remove the block in front of the character.

There is a quick draw panel at the bottom of the screen, as follows:

Action control in Minecraft Pi

Any item can be selected by scrolling the mouse wheel or using the numbers on the keyboard. The quick draw panel always hold eight items, and the current item in the hand is highlighted as follows:

Action control in Minecraft Pi

More items can be accessed by pressing the E key. This will open the inventory, as follows:

Action control in Minecraft Pi

Items in the inventory can be navigated by WSAD keys. While the inventory is open, if the Esc key is pressed, it will cancel the inventory without choosing an item. Items in the inventory can be chosen by clicking on the item, and the item will be added to the quick draw panel as well as the character's hand, as follows:

Action control in Minecraft Pi

With a block in the character's hand, right-clicking will place the block in front of the character and left-clicking will remove it. The number of blocks available to the player character is infinite.

Minecraft Pi features a creative mode, so the character does not take environmental damage (for example, when the character falls, it does not die) and is not affected by hunger. This game mode helps players focus on building and creating large projects.

Unlike other editions of Minecraft, Minecraft Pi does not feature any other gameplay modes.

Other controls in Minecraft Pi

When a game is running, pressing the Tab key will take the focus away from the game, and the mouse cursor will be freed to enable interaction with other windows on the desktop. Pressing Esc will pause the game and will take us to the game menu, where we can toggle views (as seen earlier), enable/disable sound, and quit the main window.

Note

Now, with all this information on the movements and the actions in the Minecraft Pi virtual game world, try to create a few things before continuing with the remainder of this chapter.