Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please use JAVA programming Project 2: Simple RPG battle game In this project yo

ID: 3792898 • Letter: P

Question

Please use JAVA programming

Project 2: Simple RPG battle game

In this project you are going to create a simple battle game. You will have two types of opponents: Hydrons and Zexors. Create two classes: one for Hydrons and one for Zexors. Create a DiceRoll class.

The attributes of the classes are as follows:

Hydrons: have color, height, weight, health (starts at 25), damage potential (0-10, scaled by health), attack type, number of battles won, number of battles lost, name, and home planet.

Zexors: have color, height, weight, health (starts at 25), damage potential (0-10, scaled by health), attack type, number of battles won, number of battles lost, name, and species.

DiceRoll: number of sides

The methods are up to you.

Setup: The user is asked to create 3 Hydrons and 3 Zexors, and determines how many sides to the dice. The program randomly chooses a Hydron and pits it against a Zexor. Each battle is determined by the a dice roll – each Hydron and Zexor rolls a single die. The higher of the dice rolls wins the battle. Damage is attributed to the loser, which also affects the damage potential of the loser. If a Hydron or Zexor does not engage in a battle, then their health increases by 1 to a maximum of 25. Appropriate information should be printed at the end of each battle round for all 6 creatures.

For example

Battle 1: HydronFred (damage potential 8) battles ZexorSally (damage potential 6). They are both at full health and roll a 7 sided die. ZexorSally rolls a 6 and HydronFred rolls a 1. ZexorSally wins, HydronFred has health of 19 (25-6).

Battle 2: HydronFred battles ZexorThor (damage potential 9). ZexorThor is at full health. ZexorThor rolls a 2 and HydronFred rolls 7. ZexorThor takes damage of 76% of 8.

And so on until one of the 6 creatures has a health of 0.
You will be graded based on the programming rubric for the course. This project incorporates:

Loops

Random numbers

Classes & objects

Arrays of objects

Methods

Explanation / Answer

Answer: ----------------------- package com.example; import java.util.ArrayList; import java.util.Random; import java.util.Scanner; /** * Created by Titas on 2/15/2017. */ public class RPGBattle { public static void main(String args[]) { DiceRoll die; //Arrays to hold Hydrons & Zexors Hydron[] hydronList = new Hydron[3]; Zexor[] zexorList = new Zexor[3]; ///Boolean to signify that the battle has finished boolean battleFinished = false; Scanner sc = new Scanner(System.in); System.out.print("Please select no of Sides of the Die: "); int noOfSides = sc.nextInt(); sc.nextLine(); //Creating a die object with user defined no of sides die = new DiceRoll(noOfSides); System.out.println(); //Creating 3 Hydrons System.out.println("Please create 3 Hydrons by providing required Data for each Hydron:"); for(int i=0; i