Question: I need help with this question, please! Must be implemented in Java! The purpose of this exercise is to create and engage in a fun

I need help with this question, please! Must be implemented in Java!

The purpose of this exercise is to create and engage in a fun Rogue-like game. While building this program, you will demonstrate the use of:

  • Loops
  • Conditions
  • Variable types
  • Type manipulation

Instructions

Using what you know about object-oriented programming, create a console application that allows the user to play 'Goblin Tower'. The game's scenario is that the main character is a hero walking through a tower infested by goblins. If the hero encounters a goblin, they fight each other until one of them dies. The game ends when the hero dies.

The rules for the game are as follows:

  • Each new hero starts with random max health points between 20 to 30.
  • Each new hero will start with a random attack power between 1 to 3.
  • Each new hero will start with a random defense power between 1-5.
  • Each new hero will start with an array of potions (int) with a max of 5 slots. Each slot set to 2.
  • Each new hero will start with 0 gold.
  • The hero will take a step, and possibly encounter a 'goblin.'
    • A goblin starts with 5-10 Health points, 2-3 attack power, and 1-2 defense power
    • If a goblin is found, the hero fights the goblin until either the hero or goblin's health points reach 0.
    • If the hero wins, reward the hero with 2 gold.
  • Each potion is worth their value in the array: 1 potion = 2 health points.
  • Drinking a potion will increase the heros health points up to the max random health points assigned at the start of the game.
  • After every 10 steps:
    • The hero advances one level in the game.
    • The hero may visit the "potion shop" to buy more potions for 4 gold each.
  • When the hero dies, ask the player if they would like to play again.
    • If the player says yes, create a new character with the same gold they had when they died.
    • If the player says no, print out the level the current character reached with the number of goblins slain!

Requirements

  • The completed application must be a Java Maven console application.
  • The code must use String, double, int arrays and Scanner variables correctly.
  • The code must include multiple classes that are designed appropriately for their use.
  • The program must use at least one loop and include appropriate conditional statements using if or switch statements.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!