hi,
Dein Hauptproblem ist, damit du erstmal weitermachen kannst ist:
Code:
for(int y = 0; y < 22; y++){
String c = Character.toString(zeile.charAt(y));
if(c == "0"){
feld[x][y].neuerStatus(0);
}
if(c == "1"){
feld[x][y].neuerStatus(1);
}
if(c == "2"){
feld[x][y].neuerStatus(2);
}
if(c == "3"){
feld[x][y].neuerStatus(3);
}
if(c == "A"){
monster[0] = new Grünie(x, y);
}
if(c == "B"){
monster[1] = new Pinkie(x, y);
}
if(c == "C"){
monster[2] = new Türkie(x, y);
}
if(c == "P"){
pacman.setzePosition(x, y);
}
}
}
Das muss so:
Code:
for(int x = 0; x <12; x++){
String zeile = "";
zeile = in.readLine();
for(int y = 0; y < 12; y++){
String c = Character.toString(zeile.charAt(y));
if(c.equals("0")){
System.out.println("0");
feld[x][y].neuerStatus(0);
}
if(c.equals("1")){
System.out.println("1");
feld[x][y].neuerStatus(1);
}
if(c.equals("2")){
System.out.println("2");
feld[x][y].neuerStatus(2);
}
if(c.equals("3")){
System.out.println("3");
feld[x][y].neuerStatus(3);
}
if(c.equals("A")){
System.out.println("A");
monster[0] = new Grünie(x, y);
}
if(c.equals("B")){
System.out.println("B");
monster[1] = new Pinkie(x, y);
}
if(c.equals("C")){
System.out.println("C");
monster[2] = new Türkie(x, y);
}
if(c.equals("P")){
System.out.println("P");
pacman = new Pacman(x,y);
}
}
}
So liest er ihr Map ein, zwar noch fehlerhaft, aber du kannst weitermachen^^
E: Die System.out.println("1"); etc... kannste natürlich weglassen.