import java.util.Random;
import java.util.Scanner;
public class TextGame {
public static void main(String[]args){
//System objects
Scanner userinput = new Scanner(System.in);
Random Randy = new Random();
// Enemy variables
String[]enemies = {"Die-pods", "Cammera-man","backdropdrone","Softbox-er",}; //level 1 enemies
if(Randy.equals("Die-pods")){
int DiePodsHealth = 10;
int DiePodsAttack = 20;
int diepodsdefense = 2;
}else if (Randy.equals("Cammera-man")){
int CammeraManHealth = 30;
int CammeraManAttack = 10;
int CammeraManDefense = 5;
}else if (Randy.equals("backdropdrone")){
int BackDropDroneHealth = 15;
int BackDropDroneAttack = 15;
int BackDropDroneDefense = 1;
}else if (Randy.equals("Softbox-er")){
int SoftBoxersHealth = 25;
int SoftBoxersAttack = 10;
int SoftBoxersDefense = 5;
}
// Player Variables
int Health = 100;
int baseAttack = 20;
int defense = 5;
boolean running = true;
System.out.print("Welcome to my base of operations - MR.Shutter");
GAME:
while(running){
int Enemies = Randy.nextInt(enemies.length);
System.out.println(enemies + "has appeared!");
}
}
}
I want to make it so the computer picks a random monster and shows up in the console. However, its giving me a lot of 'equals' between objects of inconvertible types 'Random' and 'String'. How would I go about solving this.