import java.util.*;
class BattleGob extends BattleAttempt2
{
public void Battle()
{
if (cclass<=1)
{
while (health >0)
{
while (monster >0)
{
//all 1000 lines in here
}
}
}
}
}That is the code for the method.
This is the code for the main thing
import java.util.*;
public class BattleAttempt2
{
public static void main(String[] args)
{
BattleGob battle = new BattleGob();
int health = 20;
int monster = 20;
int roll;
int damage;
int option;
int spell1 = 5;
int spell2 = 5;
int spell3 = 5;
int spell4 = 5;
int spell5 = 2;
int count = 10;
int rejuv = 0;
int cclass;
String cclassname;
String name;
Scanner keyboard = new Scanner(System.in);
System.out.println("Choose your class: ");
System.out.println("1) Fighter (+2 base attack +4 damage no healing or magic spells)");
System.out.println("2) Theif (+1 base attack no bonus damage two attacks no magic or healing)");
System.out.println("3) Mage (No bonuses to attack or damage healing and magic spells)");
cclass = keyboard.nextInt();
//More program after this and method Battle is called in thereI get an error in the method saying "Cannot find variable 'cclass'"
Please don't yell at me for too many posts in a week... I'm a nerd with very little java experience

Help



Back to top









