Hallo Leute mal wieder in diesem Forum mit nem neuen Problem
Mein Code:
gibt mir immer das aus
Mein Code:
Java:
import java.io.*;
import java.util.*;
public class WorldLoader {
public void load(File worldLoadPath){
try{
Scanner worldScanner = new Scanner(new File("save/level1.lv"));
while(worldScanner.hasNext()){
for(int y = 0; y<Screen.worldHeight; y++){
for(int x = 0; x<Screen.worldWidth; x++){
Screen.underGround[x][y] = worldScanner.nextInt();
System.out.println("Lade: Underground [" + x + "] [" + y + "] = ");
}
}
for(int y = 0; y<Screen.worldHeight; y++){
for(int x = 0; x<Screen.worldWidth; x++){
Screen.ground[x][y] = worldScanner.nextInt();
}
}
worldScanner.close();
for(int y = 0; y<Screen.worldHeight; y++){
for(int x = 0; x<Screen.worldWidth; x++){
Screen.upperGround[x][y] = worldScanner.nextInt();
}
}
}
} catch(IOException e) { e.printStackTrace();
System.err.println("System konnte nicht erfolgreich laden!");}
}
}
gibt mir immer das aus
Code:
java.io.FileNotFoundException: save\level1.lv (Das System kann den angegebenen Pfad nicht finden)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.util.Scanner.<init>(Unknown Source)
at WorldLoader.load(WorldLoader.java:9)
at Screen.loader(Screen.java:26)
at Screen.<init>(Screen.java:16)
at Window.<init>(Window.java:7)
at Launcher.main(Launcher.java:12)
System konnte nicht erfolgreich laden!