Java: Methode wird nicht erkannt?
Hallo, ich arbeite gerade an einem Text Adventure. Intellij erkennt meine Methoden nicht. Hat jemand Lösungsvorschläge?
Code:
public class main {
public static void main (String[] args){
player();
enemies();
cases();
}
public static void player() {
String name = "Shadow";
int health = 50;
int damage = 30;
}
public static void enemies() {
public static void dragon() {
String name = "Barbaton";
int health = 100;
int damage = 40;
}
public static void lion() {
String name = "Eon";
int health = 85;
int damage = 55;
}
public static void pig() {
String name = "Memba";
int health = 20;
int damage = 5;
}
public static void frog() {
String name = "Zee";
int health = 5;
int damage = 1;
}
public static void zebra() {
String name = "Zoy";
int health = 28;
int damage = 18;
}
public static void monkey() {
String name = "Bart";
int health = 45;
int damage = 38;
}
public static void fox() {
String name = "Foxie";
int health = 35;
int damage = 24;
}
}
}
public static void cases() {
int min = 1;
int max = 8;
int random_int = (int)Math.floor(Math.random()*(max-min+1)+min);
if(random_int == 1){
System.out.println("Du hast Barbaton(Drache) als Gegner bekommen.");
}
else if (random_int == 2){
System.out.println("Du hast Eon(Löwe) als Gegner bekommen.");
}
else if (random_int == 3){
System.out.println("Du hast Memba(Schwein) als Gegner bekommen.");
}
else if (random_int == 4){
System.out.println("Du hast Zee(Frosch) als Gegner bekommen.");
}
else if (random_int == 5){
System.out.println("Du hast Zoy(Zebra) als Gegner bekommen.");
}
else if (random_int == 6){
System.out.println("Du hast Bart(Affe) als Gegner bekommen.");
}
else if (random_int == 7){
System.out.println("Du hast Foxie(Fuchs) als Gegner bekommen.");
}
else {
System.out.println("");
}
}
}
programmieren,
Java