Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Build classes and subclasses needed for a game called Outlier Odyssey. In this game, a player will navigate a two-dimensional map from one corner to

Build classes and subclasses needed for a game called Outlier Odyssey. In this game, a player will navigate a two-dimensional map from one corner to another with limited resources while encountering hazards. Make sure to follow the UML diagram when solving the problem. 

 

Running the Game

The maze is a 2D String array. The game will start with a reserved cell for the player (P) and one random cell containing a magical gem (GEM)! Every other cell will be randomly assigned to one of the following hazards: wolf, bear, elk, or hare. Hazards will have higher-value costs further into the board.

The player starts in the top-left corner with 500 health and must travel to the bottom-right corner without running out of health. For each turn, the player can move up, down, left, or right. After selecting a direction, the player is given a preview of the hazard in the chosen cell. Then, they can confirm the move or opt out and choose a new direction.

As the player traverses the maze, their health changes according to the hazards they reach. Once the player has visited a cell, the cell value changes to "X"—the hazard has been neutralized and the player can revisit the cell without any change in health.

The game ends when the player reaches the bottom right-hand corner of the maze or when they run out of health.

Implementation

You will be responsible for completing components in four classes. You can either start from the top of the class hierarchy and work down or start at the bottom and work up. As you work, initialize and test objects in the OutlierOdyssey.java file (at the bottom). Make sure to test frequently! The following UML diagram displays the full class structure with components that need to be completed in pink:

 

Game board: GameBoard player: Player + Game ( ) + Game (int, int) + playGame (Scanner) - validMove (char): Cell - makeMove (Cell, Scanner) t 1 Player - health: int - position: int + Player() + Player (int) getHealth(): int setHealth (int) getPosition (): int setPosition (int) 1 1 GameBoard - board: Cell [] [] rows: int cols: int lastCell: int + GameBoard() + GameBoard (int, int) - initBoard () - initCel10 () - initGemCell() + getLastCell(): int + getBoard(): Cell [] [] + getCoord (int): int[] + displayBoard (Player) 1 Cell count: int num: int cellItem: CellItem cleared: boolean visited: boolean + Cell() initAnimal (int): Animal + getCellItem(): cellItem + setCellItem (CellItem) + getID(): int + getCleared (): boolean + setCleared (boolean) + getVisited (): boolean + setVisited (boolean) + getCellCost(): int + toString(): String + equals (Object): boolean 1 1 CellItem # name: String #cost: int + CellItem (String) + CellItem (String, int) + getCost (): int + getName(): String + toString(): String Animal + Animal (String, int, int)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

game the player hazards and the map Lets start by defining the main class... 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

Microeconomics An Intuitive Approach with Calculus

Authors: Thomas Nechyba

1st edition

538453257, 978-0538453257

More Books

Students also viewed these Programming questions

Question

Why is there a cost associated with reinvested earnings?

Answered: 1 week ago

Question

3-11. What organizational and individual factors affect

Answered: 1 week ago

Question

a sin(2x) x Let f(x)=2x+1 In(be)

Answered: 1 week ago

Question

helps intialize a git repository

Answered: 1 week ago