Guest User

Untitled

a guest
Apr 13th, 2016
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. package Window;
  2.  
  3. import org.lwjgl.opengl.Display;
  4.  
  5. import Functions.renderer;
  6.  
  7. public class GridHandler {
  8.  
  9. int WIDTH = 1600;
  10. int HEIGHT = 832;
  11. int tileWidth = 64;
  12. int tileHeight = 64;
  13.  
  14. public static Tile[][] map;
  15.  
  16. public GridHandler(){
  17. map = new Tile[25][13];
  18. for (int i = 0; i < map.length; i++){
  19. for (int j = 0; j < map[i].length; j++){
  20. map[i][j] = new Tile(i * 64, j * 64, 64, 64, TileType.stone);
  21. }
  22. }
  23. }
  24.  
  25. public GridHandler(int[][] newMap){
  26. map = new Tile[25][13];
  27. for (int i = 0; i < map.length; i++){
  28. for (int j = 0; j < map[i].length; j++){
  29. if(newMap[j][i] == 0){
  30. map[i][j] = new Tile(i * 64, j * 64, 64, 64, TileType.stone);
  31. }
  32. else{
  33. Display.destroy();
  34. }
  35. }
  36. }
  37. }
  38.  
  39. public void draw(){
  40. for (int i = 0; i < map.length; i++){
  41. for (int j = 0; j < map[i].length; j++){
  42. Tile t = map[i][j];
  43. renderer.drawQuadTex(t.getTexture(), t.getX(), t.getY(), t.getWidth(), t.getHeight());
  44. }
  45. }
  46. }
  47.  
  48. }
Add Comment
Please, Sign In to add comment