Hardware Reference
In-Depth Information
Remember the setBlocks() function you used to build a house in Adventure 3? You
are now going to use it to build your arena.
Start up Minecraft, IDLE, and if you are working on a PC or a Mac, start up the Bukkit
server too. You should have had a bit of practice with starting everything up by now,
but refer back to Adventure 1 if you need any reminders.
Start by creating a new program for the Crafty Crossing game. The first step is to set up
the initial structure of the game:
1. Open IDLE, create a new file and save the file as CraftyCrossing.py in the
MyAdventures folder.
2. Import the modules you need. You will use a new module thread, which will be
described in Part 2 when you create the obstacles:
import mcpi.minecraft as minecraft
import mcpi.block as block
import mcpi.minecraftstuff as minecraftstuff
import time
import random
import thread
3. Create three constants for the game arena, which are its width, height and length
as x, y, z:
ARENAX = 10
ARENAZ = 20
ARENAY = 3
4. Now insert the functions for the program. You will build these through the
adventure, until you have a complete game:
def createArena(pos):
pass
def theWall(arenaPos, wallZPos):
pass
def theRiver(arenaPos, riverZPos):
pass
def theHoles(arenaPos, holesZPos):
pass
def createDiamonds(arenaPos, number):
pass
 
Search WWH ::




Custom Search