コード例 #1
0
ファイル: Screen.java プロジェクト: Baefulwrath/RPG_Society
 public void drawWorld(Graphics2D g2d, World w) {
   Chunk[] c = w.getChunks();
   for (int ci = 0; ci < c.length; ci++) {
     Chunk ch = c[ci];
     for (int tx = 0; tx < ch.tiles.length; tx++) {
       for (int ty = 0; ty < ch.tiles[tx].length; ty++) {
         drawTile(g2d, ch.tiles[tx][ty]);
         if (Main.showChunks) {
           g2d.setColor(Main.getRandomColor(true));
           Rectangle r = ch.getR();
           g2d.drawRect(r.x, r.y, r.width, r.height);
         }
       }
     }
   }
 }