Test the Gorilla class by adding a new Gorilla object to the world and then running the scenario.

The gorilla should walk. If the gorilla does not walk, make sure you deleted the act() method as specified in step 4. Notice that the gorilla will pay no attention to floors or walls. To create the proper illusion we need to carefully place and set the range of the gorilla's movement.

Open the editor for the GameManager class and add the following method:

If you have not already completed the exercises, or had problems with them, download the Platformer 5 scenario file and save it to a convenient location like the desktop. Then unzip and open the scenario.

Also in the Fly class, add an intializeImages() method, using class Gorilla as an example.

public static void initializeImages()
{
// Add code here
}

For more information see section 13.1.4: Creating an NPC. You will need to add six (6) images to each animation rather than the three used to make gorillas. Notice that the scenario already includes the images, which start with the word, "fly".

Add a default constructor to the new class, using class Gorilla as an example. Within the constructor, create left and right movement animations and dying animations.

Compile the class and verify there are no errors. Resolve any errors you find, getting help from a guild mate or the instructor as needed.

In Fly, remove the act() method so that the Creature superclass act() method will operate instead.

Open the GameManager class and add a method named: makeFlies() that adds flies to the scenario.

private void makeFlies()
{
// Add flies to world
}

Call the method from the GameManager constructor just after the makeGorillas() method.

Add at least two flies to the world, using the makeGorillas() method as an example.

Hint: run the player to the center of the world and pause the game. Position the flies and then use the Inspect utility to determine (x, y) coordinates. Add about 320 to each x-coordinate to determine the map position. If you still have difficulty, click here for an example: .