Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You will make a simple game where the user creates a wild jungle and navigates around the world exploring various animals and adding them to

You will make a simple game where the user creates a wild jungle and navigates around the world exploring various animals and adding them to the observed animals list!

Here are the instructions:

At the beginning of the program, introduce the program and explain to the user how the game works:

Welcome to the jungle world creator!

In this game, you will be inserting animals in certain places in the world that you create! You will also be allowed to remove animals from certain locations before you start exploring!

Once you start exploring, you will navigate around the world to observe the animals that you have inserted.

The game will keep track of all the animals you have observed!

You will be using 3 parallel two-dimensional arrays for this program as well as a 1D array:

2D String array to create the visible world the user navigates in.

2D String array that keeps track of animals in the world.

2D boolean array that keeps track of whether the spot was explored or not.

1D String array to keep track of observed animals. Its length should be the length of world*width of the world.

Notes:

Make sure to initialize all the values in the boolean array to false, except the starting position (0,0) is set to true.

Make sure to initialize all the values in the animalWorld and observedAnimals array to be because otherwise it will be initialized to null and you need to deal with it using if statements.

Make the 2D boolean array a global variableand initialize it only in the main method.

You must have the following methods created and used within your program:

1.makeWorld(String[][] world, int posX, int posY)

2.printMainMenu()

1. Insert an animal into the world

2. Remove an animal from the world

3. Explore the world

3.printMoveMenu()

W. Move Forward

A. Move Left

S. Move Backward

D. Move Right

I. Display observed animals

N. Sort the observed animals list by alphabetical order

E. Exit

4.insertAnimalToWorld(String[][] animalLocations)

- The x and y coordinates are in the worlds boundaries

- The area [x,y] is not occupied by another animal

If the conditions are not met prompt the user to enter the coordinates as well as the animal name again until the conditions above are met.

5.removeAnimalFromWorld(String[][] animalLocations)

- The x and y coordinates are in the worlds boundaries

- The area [x,y] is not empty (contains an animal)

If the conditions are not met prompt the user to enter the coordinates until the conditions above are met.

Hint:To remove the animal you can just set the String at [x,y] to .

6.isEmptyBlock(String[][] animalWorld, int x, int y) ? Returns false if the array has an animal at [x,y] and true if [x,y] is empty.

7.updateObservedAnimals(String[] observedAnimals, String animal)

8.printWorld(String[][] world)

9.move(String[][] world, int x, int y, String[] observedAnimals, String[][] animalLocations)

10.explore(String[][] world, String[][] animalLocations, String[] observedAnimals)

11.printObservedAnimals(String[] observedAnimals)

12.isExplored(int x, int y)

13.sortAnimalList(String[] observedAnimals) Bubble Sort or Selection Sort algorithms. You are NOTallowed to use Arrays.sort() for this method.

***JAVA PROGRAMMING IN ECLIPSE***

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design For Mere Mortals

Authors: Michael J Hernandez

4th Edition

978-0136788041

More Books

Students also viewed these Databases questions

Question

8. Design office space to facilitate interaction between employees.

Answered: 1 week ago