Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Window;
- import org.lwjgl.opengl.Display;
- import Functions.renderer;
- public class GridHandler {
- int WIDTH = 1600;
- int HEIGHT = 832;
- int tileWidth = 64;
- int tileHeight = 64;
- public static Tile[][] map;
- public GridHandler(){
- map = new Tile[25][13];
- for (int i = 0; i < map.length; i++){
- for (int j = 0; j < map[i].length; j++){
- map[i][j] = new Tile(i * 64, j * 64, 64, 64, TileType.stone);
- }
- }
- }
- public GridHandler(int[][] newMap){
- map = new Tile[25][13];
- for (int i = 0; i < map.length; i++){
- for (int j = 0; j < map[i].length; j++){
- if(newMap[j][i] == 0){
- map[i][j] = new Tile(i * 64, j * 64, 64, 64, TileType.stone);
- }
- else{
- Display.destroy();
- }
- }
- }
- }
- public void draw(){
- for (int i = 0; i < map.length; i++){
- for (int j = 0; j < map[i].length; j++){
- Tile t = map[i][j];
- renderer.drawQuadTex(t.getTexture(), t.getX(), t.getY(), t.getWidth(), t.getHeight());
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment