Raspberry Craft
No two ways about it: For knowledge to stick, the training must be entertaining. Fortunately, learning to program in Python has just become a lot more fun – now you can learn by playing Minecraft.
No two ways about it: For knowledge to stick, the training must be entertaining. Fortunately, learning to program in Python has just become a lot more fun – now you can learn by playing Minecraft.
Minecraft [1], the "social lego" with zombies, skeletons, and creepers, has become a social phenomenon, earning a place in the Smithsonian's "Art of Videogames," a feature-length documentary [2], an article in The Guardian, and ports to nearly every modern personal computing platform in existence, including the Raspberry Pi.
Although you can run a Minecraft server from your Pi, hardware constraints won't allow you to play the full version directly on your Pi. However, a client version has been adapted to the Raspberry Pi, and that is the one I'll be using in this article.
The Pi version of Minecraft [3] is a bit limited, in that you can only use the Creative playing mode. This is similar to early versions of the game for mobile devices. In this mode, you have no mobs (animals, monsters, and non-player humans – a.k.a. "villagers"), and although you can dig, you can't pick up blocks (mine) or transform combinations of blocks into new objects (craft). Instead, in your inventory, you have an infinite number of the blocks and tools you need, and you use those to do your building.
To start, Creative mode might make the Pi version less fun, but it is offset by the fact that the creators have included a nice and simple API that allows you to program new features into the game using the Python programming language.
To install Minecraft, download the package [4] into a directory of your choice and unzip it from a terminal with:
$ tar zxvf minecraft-pi-0.1.1.tar.gz
Now you can visit the mcpi
directory (cd mcpi
) and start playing the game by typing:
$ ./minecraft-pi
When you run Minecraft, you can choose either Start Game or Join Game, if a game is running on a server (Figure 1). For simplicity's sake, I'll be running a single-player game on a local server (i.e., I'll choose Start Game).
Although I will not delve into everything you can do in Minecraft, it'll help if you have a basic knowledge of how to make your way around the world. Table 1 lists some of the ways to navigate, take action, or even build something!
Tabelle 1
Minecraft Controls
Keyboard |
|
---|---|
Key | Action |
w |
Move in the direction the character is facing |
a |
Sidestep left |
s |
Move backward |
d |
Sidestep right |
Space bar |
Jump; double tap to start/stop flying, hold to fly higher |
Shift |
Crouch; hold to fly lower |
e |
Open inventory (use w, a, s, and d keys to navigate) |
1-8 |
Select inventory slot item to use |
Esc |
Show/hide menu |
Tab |
Release mouse without showing menu |
Enter |
Confirm menu selection |
Mouse |
|
Gesture | Action |
Move |
Look/turn around |
Left-click (hold) |
Hit block to remove it |
Right-click |
Place block; hit block with sword |
Mouse wheel |
Select inventory slot item to use |
Pages: 6
Price $15.99
(incl. VAT)