Hardware Reference
In-Depth Information
6.
Create the shape blocks that will make up the bridge. This is done in a similar
way to the wall by using two nested
for
loops, one for the bridge width (x) and
one for the width of the river (z):
bridgeBlocks = []
for x in range(0, BRIDGEWIDTH):
for z in range(0, RIVERWIDTH - 2):
bridgeBlocks.append(minecraftstuff.ShapeBlock(x,
0,
z,
block.WOOD_PLANKS.id))
When creating the bridge, 2 is subtracted from
RIVERWIDTH
to create a gap of
one block between the river bank and the bridge, meaning the player will have to
jump on and off the bridge (see FigureĀ 9-8).
FIGURE.9-8
Because the bridge does not completely span the river, your player has
to jump.
7.
Create the shape of the bridge by passing in the
bridgePos
and
bridge-
Blocks
variables you created in steps 5 and 6:
bridgeShape = minecraftstuff.MinecraftShape(
mc, bridgePos, bridgeBlocks)