Question: 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, 

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

1 Expert Approved Answer
Step: 1 Unlock

game the player hazards and the map Lets start by defining the main class... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!