Basically nothing

master
bob 2022-06-02 14:48:16 -04:00
parent 588f7a5263
commit b9c4ee8120
3 changed files with 21 additions and 2 deletions

View File

@ -11,6 +11,7 @@ import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -1,9 +1,27 @@
import java.io.BufferedReader;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Scanner;
public class MapReader { public class MapReader {
public static void inputMap(ArrayList<Tile> map, File file){ public static void inputMap(ArrayList<Tile> map, File file) throws FileNotFoundException {
int x = 0; int x = 0;
int y = 0; int y = 0;
Scanner sc = new Scanner(new BufferedReader(new FileReader("src/Level1.txt")));
int rows = 7;
int columns = 7;
while(sc.hasNextLine()) {
for (int i=0; i<7; i++) {
String[] line = sc.nextLine().trim().split(" ");
for (int j=0; j<line.length; j++) {
map.add(new Tile(x,y));
x+=Tile.length;
}
x=0;
y+=Tile.length;
}
}
} }
} }

View File

@ -4,7 +4,7 @@ import java.awt.*;
public class Tile { public class Tile {
public int x; public int x;
public int y; public int y;
public static final int length = 30; public static final int length = 35;
public Tile(int x, int y){ public Tile(int x, int y){
this.x = x; this.x = x;
this.y = y; this.y = y;