Hardware Reference
In-Depth Information
elif b != block.GOLD_BLOCK.id:
mc.setBlock(pos.x, pos.y-1, pos.z, block.GOLD_BLOCK.id)
coordinate = [pos.x, pos.y-1, pos.z]
bridge.append(coordinate)
score = score - 1
2. Congratulations! You have finished writing your program. As the game is ready
to be played properly now, modify the time.sleep(1) in the game loop to
sleep every 0.1 seconds. This will run the game loop 10 times per second. The
timer in homingBeacon will count 10 of these and therefore only display a mes-
sage on the Minecraft chat every second.
Save and run your program. Check that the gold trail disappears once you collect the
treasure, and that your score goes down for every gold block that you spend.
Now all you have to do is enjoy the game! See how hard it is to get a good score by
collecting the treasure?
FigureĀ 4-7 shows the score and homing beacon display on the Minecraft chat.
FIGURE.4-7 The homing beacon showing vital statistics as you play skyHunt
Search WWH ::




Custom Search