Hardware Reference
In-Depth Information
CHALLENGE
When the player's is put at the start of the arena, he starts the level in the right
hand corner. Would it be better if he started in the middle? Change the code so
that the player is put in the middle of the arena rather than the corner at the
start of each level.
Collecting Diamonds
The main objective of the game is to collect diamonds. You are now going to program
these to appear in random positions in the arena (see Figure 9-11); the player will collect
the diamonds by “hitting” them (or rather, right-clicking the block while holding a sword).
FIGURE.9-11 Diamonds appear in random positions.
he diamonds disappear as soon as they have been hit, and, once he has collected all the
diamonds, the player can go on to complete the level by getting to the other side of the
arena.
Update the createDiamonds() function and call it from the game loop by following
these steps:
1. Find createDiamonds() function by looking for the following in the code you
wrote earlier:
def createDiamonds(arenaPos, number):
pass
 
Search WWH ::




Custom Search