Overall the project builds on an earlier project to get a simple X-Wing into Minecraft on a Raspberry Pi. The goal was get Python to build and move the X-Wing. Details of this project can be found here.
Main revision: In this project and the earlier one is based around Python 3 running the Raspbian 'Jessie' November version OS. Also additional libraries may need to be add to get the minecraftstuff (such as ShapeBlock() and MinecraftShape()). Details on how to obtain and install these can be found at http://www.stuffaboutcode.com/2013/11/coding-shapes-in-minecraft.html .
In this post the additional of Pirmoroni's Skywriter is included to allow movements of a hand or a finger to enable the X-Wing to take-off, land, move forward or backward.
It builds on ideas from the book Adventures in Minecraft on using Python and Minecraft using a Raspberry Pi.
Before you start, to use the Skywriter, in the terminal you need to add curl -sSL get.pimoroni.com/skywriter | bash
To start with we just placed the X-Wing above the player by placing blocks in the shape (roughly) of the X-Wing based around the method MinecraftShape (see Chapter 8 of Adventures in Minecraft ).
- Find the position of the player;
- To avoid building on top the player the starting position of the X-Wing is set by:
- add 5 to the x position of the player;
- add 10 to the y position of the player(The bit I have to keep reminding myself is the y-axis is vertical.);
- add 5 to the z position of the player;
- Using these values build using, Wool blocks, the X-Wing - 0 for white, and 14 for red blocks;
- If a flick starts at the top of the board (or "north") this moves the X-Wing down towards the ground;
- If a flick starts at the bottom of the board (or "south") this moves the X-Wing vertically up;
- If a flick starts on the right of the board (or "east") the X-Wing moves backwards horizontally;
- if a flick starts on the left of the board (or "west") the X-Wing moves forward.
For more details on Minecraft and Python I would suggest going to http://www.stuffaboutcode.com/2013/11/coding-shapes-in-minecraft.html especially on how to download the software to implement MinecraftShape.
If you do use or modify this please leave a comment, I would love to see what others do with it.
All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with.