Esempio n. 1
0
  private void drawEntities() {
    Array<Entity> entites = world.getEntities();

    for (Entity entity : entites) {
      entity.render(spriteBatch);
    }
  }
Esempio n. 2
0
  private void drawDebug() {
    debugRenderer.setProjectionMatrix(cam.combined);
    debugRenderer.begin(ShapeType.Line);
    for (Block block : world.getBlocks((int) CAMERA_WIDTH, (int) CAMERA_HEIGHT)) {
      Rectangle rect = block.getBounds();
      debugRenderer.setColor(new Color(1, 0, 0, 1));
      debugRenderer.rect(rect.x, rect.y, rect.width, rect.height);
    }

    for (Entity e : world.getEntities()) {
      Rectangle rect = e.getBounds();
      debugRenderer.setColor(new Color(0, 1, 1, 1));
      debugRenderer.rect(rect.x, rect.y, rect.width, rect.height);
    }

    Digger jaxon = world.getJaxon();
    Rectangle rect = jaxon.getBounds();
    debugRenderer.setColor(new Color(0, 1, 0, 1));
    debugRenderer.rect(rect.x, rect.y, rect.width, rect.height);
    debugRenderer.end();
  }