[PYTHON] [I touched the Raspberry Pi (1)] I summarized the basic operations of Minecraft Pi Edition (2015.5.23 pre-release)

Introduction

Minecraft, a game familiar all over the world. Today I would like to explain the basic operation of "Minecraft Pi Edition" which should be called the Raspberry Pi version.

1. About movement

When you open MineCraft Pi Edition, the number Pos is displayed in the upper left, which is the current position. The arrangement of the x, y, and z coordinates is as shown in the figure below. It's a good idea to remember that the width direction is x, the height is y, and the depth is z.

g1.png

How each key works
key Direction of movement coordinates
A key Move to the left x-axis negative direction
D key Move to the right x-axis positive direction
W key Move up z-axis positive direction
S key Move down z-axis negative direction
space Move vertically upward y-axis positive direction
shift Move vertically and downward y-axis negative direction

You may not be able to escape because you often fall into the sea while operating. In such a case, it is convenient to move to the air once with space or shift.

2. About the menu screen In

Minecraft Pi Edition, you can press the "ESC" key to move to the following menu screen.

ex2.jpg

This menu screen will be described below. </ p>

button work
Button on the left on the screen [1] Sound ON / OFF
Right button on the screen [2] Switching between bird's-eye view / self-viewpoint
Back to game[3] Return to game
Quit to game[4] Quit the game

3. Place the block on the ground

Next, I will explain the key operations and mouse operations required to place blocks in the air or on the ground and create free shapes, which is the heart of Minecraft Pi Edition.

button work
Left mouse click Remove one existing block (when equipped with a sword)
Right mouse click Place blocks on the map
Mouse wheel Select the block to place on the map from the palette below
E key Move to the block selection screen to be placed on the map

When you press the

E key, the following screen will be displayed, and you can select your favorite block from various blocks. </ p>

ex3.jpg

4. Let's display minecraft in Python

Finally, I would like to introduce the operation from the Python side until it is displayed as minecraft. First of all, if you write the program as follows with vi or a text editor,

message.py


#Call API for minecraft
from mcpi import minecraft
#Create a new object for minecraft
mc = minecraft.Minecraft.create()
#Put your favorite message in the argument of postToChat and complete
mc.postToChat("minecraft")

If you cd to the folder containing the

file and enter "python specified file name.py", a message will be displayed on the screen. </ p>

 ex1.jpg

5. Finally

Today, I briefly summarized the basic operation of the game and the operation with Python. Next time, I would like to explain how to place blocks using Python.

Recommended Posts