Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
Background should be rendered/drawn in the same way as Project 1.
Entities
There is only one player, and a number of other entities, zombies and sandwich, in the tomb that
the Player can interact with.
• Zombie and sandwich are stationary entity. See Project 1 for where the image
files locate.
• Treasure: a stationary entity in the tomb. Its image is located at res/images/treasure.png.
Figure 2: Images of Characters in ShadowTreasure for Project 2. Note, I enlarge the Bullet in (e),
but it is just a small green dot when it’s drawn on the screen.
See Figure 2(d). There is only one treasure in ShadowTreasure. The final goal of the player
is to reach/meet treasure. But, the treasure can be reached/met only if all zombies in
the tomb are killed. See Algorithm 1 for how to kill zombies.
Player
Image file and attributes energy and step size are the same as Project 1. Note, you
still need to print the energy on the screen as in Project 1. In project, the player can
shoot the bullet to kill zombies.
• Bullet : a moving object in the tomb. Its image is located at res/images/shot.png.When
it’s shooting, the step size of bullet is 25. Each shot consumes energy 3. The same as the
player, bullet movements only happen in each tick.
Initial Positions
The same as Project 1, the initial positions of the entities are determined by a environment file,
located at res/environment.csv. This is a comma-separated value (CSV) file with rows in the
following format for zombie and sandwich:
[Type], x-coordinate, y-coordinate
where the [Type] is either Zombie, Sandwich or Treasure and the x-coordinate and y-coordinate
show the location of the entity. A row in the file for the Player will have the format:
Player, x-coordinate, y-coordinate, energy level
where x-coordinate and y-coordinate show the initial location of the Player and the last column,
energy level, shows the starting energy level of the Player.
You must actually load the environment file—copying and pasting the data, for example, is
not allowed. You must load this environment file and create the corresponding entities in your
simulation. When we testing your code, we may use a di↵erent environment file. You should
assume that, in each environment file, there will be only one player, only one treasure and a
number of zombies and sandwiches. Note the number of zombies and sandwiches may
vary.