此代码由于某种原因无法运行。这是一款简单的角色扮演游戏。`
导入 java.util.Scanner;
public class My_first_RPG {
double exp;
double attack;
double vitality;
double armor;
double mana;
int skill() {
return (int) (attack*mana);
}
}
class character {
public static void main(String args[])
throws java.io.IOException {
My_first_RPG Mage = new My_first_RPG();
My_first_RPG Warrior = new My_first_RPG();
My_first_RPG Archer = new My_first_RPG();
My_first_RPG Dwarven_Mech = new My_first_RPG();
My_first_RPG Steel_Golem = new My_first_RPG();
int world[][] = new int[10][10];
world[1][1]=2;
Mage.attack = 75;
Mage.vitality = 1;
Mage.armor = 10;
Mage.mana = 200;
Warrior.attack = 100;
Warrior.vitality = 2;
Warrior.armor = 20;
Warrior.mana = 100;
Archer.attack = 65;
Archer.vitality = 1;
Archer.armor = 15;
Archer.mana = 150;
Dwarven_Mech.attack = 125;
Dwarven_Mech.vitality = 0.5;
Dwarven_Mech.armor = 5;
Dwarven_Mech.mana = 75;
Steel_Golem.attack = 50;
Steel_Golem.vitality = 0;
Steel_Golem.armor = 30;
Steel_Golem.mana = 50;
System.out.println("Choose your Hero.");
System.out.println("1. Mage");
System.out.println("2. Warrior");
System.out.println("3. Archer");
System.out.println("4. Dwarven Mech");
System.out.println("5. Steel Golem");
Scanner sc = new Scanner(System.in);
int choice = sc.nextInt();
switch(choice) {
case 1:
System.out.println("You are now a Mage.");
case 2:
System.out.println("You are now a Warrior.");
case 3:
System.out.println("You are now a Archer.");
case 4:
System.out.println("You are now a Dwarven Mech.");
case 5:
System.out.println("You are now a Steel Golem.");
}
}
class Grasslands {
}
}
` 即使我有 public static void main,代码也无法运行。有问题吗?另外,阵法和草地类还没有完成。