Hardware Reference
In-Depth Information
Further Adventures
in.Simulation
In this adventure you have used algorithms and rules to simulate a friend and an alien
invasion—how about taking it further and simulating other things such as a flock of
birds (or blocks), waves across the oceans in Minecraft in or a complete cellular system
such as Conway's Game of Life made out of blocks.
To find out more about Conway's game of life visit env.wikipedia.org/wiki/Conway's_
Game_of_Life .
Quick Reference Table
Command
Description
import random
Imports the Python random module
random.randint(start, end)
Creates a random number between the
start and end numbers
import minecraftstuff
Imports the minecraftstuff extensions
module, which is included in the Starter Kit
mc.getHeight(x,z)
Gets the height (y co-ordinate) of the land
(i.e. the first block down from the sky that
isn't AIR ) for a horizontal position (x,z)
Creates the MinecraftDrawing object
mcdrawing = minecraftstuff.
MinecraftDrawing(mc)
copyOfPosition = position.clone()
Creates a copy (clone) of a Minecraft
position
mcdrawing.getLine(x1, y1, z1, x2,
y2, z2)
Gets all the blocks in a line between two
points
shapeBlocks = [
Creates a list of shapeBlocks that repre-
sent a MinecraftShape
minecraftstuff.ShapeBlock(1,0,0,
block.DIRT.id),
minecraftstuff.ShapeBlock(0,0,1,
block.DIRT.id)]
Creates a MinecraftShape of the shape-
Blocks passed to it at the position
specified
shape = minecraftstuff.
MinecraftShape(mc, pos, shapeBlocks)
shape.moveBy(x,y,z)
Moves a MinecraftShape by the value in
x,y,z
shape.move(x,y,z)
Moves a MinecraftShape to the position
x,y,z
Clears the MinecraftShape
shape.clear()
shape.draw()
Draws the MinecraftShape
 
Search WWH ::




Custom Search