final float color = Color.toFloatBits(batchColor.r, batchColor.g, batchColor.b, batchColor.a * layer.getOpacity()); final int layerWidth = layer.getWidth(); final int layerHeight = layer.getHeight();
final float color = Color.toFloatBits(batchColor.r, batchColor.g, batchColor.b, batchColor.a * layer.getOpacity()); final int layerWidth = layer.getWidth(); final int layerHeight = layer.getHeight();
private void renderDebug () { debugRenderer.setProjectionMatrix(camera.combined); debugRenderer.begin(ShapeType.Line); debugRenderer.setColor(Color.RED); debugRenderer.rect(koala.position.x, koala.position.y, Koala.WIDTH, Koala.HEIGHT); debugRenderer.setColor(Color.YELLOW); TiledMapTileLayer layer = (TiledMapTileLayer)map.getLayers().get("walls"); for (int y = 0; y <= layer.getHeight(); y++) { for (int x = 0; x <= layer.getWidth(); x++) { Cell cell = layer.getCell(x, y); if (cell != null) { if (camera.frustum.boundsInFrustum(x + 0.5f, y + 0.5f, 0, 1, 1, 0)) debugRenderer.rect(x, y, 1, 1); } } } debugRenderer.end(); }
final float color = Color.toFloatBits(batchColor.r, batchColor.g, batchColor.b, batchColor.a * layer.getOpacity()); final int layerWidth = layer.getWidth(); final int layerHeight = layer.getHeight();
final float color = Color.toFloatBits(batchColor.r, batchColor.g, batchColor.b, batchColor.a * layer.getOpacity()); final int layerWidth = layer.getWidth(); final int layerHeight = layer.getHeight();
final float color = Color.toFloatBits(batchColor.r, batchColor.g, batchColor.b, batchColor.a * layer.getOpacity()); final int layerWidth = layer.getWidth(); final int layerHeight = layer.getHeight();
final float color = Color.toFloatBits(batchColor.r, batchColor.g, batchColor.b, batchColor.a * layer.getOpacity()); final int layerWidth = layer.getWidth(); final int layerHeight = layer.getHeight();
final float color = Color.toFloatBits(1, 1, 1, layer.getOpacity()); final int layerWidth = layer.getWidth(); final int layerHeight = layer.getHeight();
final float color = Color.toFloatBits(1, 1, 1, layer.getOpacity()); final int layerWidth = layer.getWidth(); final int layerHeight = layer.getHeight();
TiledMapTileLayer layer0 = (TiledMapTileLayer) map.getLayers().get(0); Vector3 center = new Vector3(layer0.getWidth() * layer0.getTileWidth() / 2, layer0.getHeight() * layer0.getTileHeight() / 2, 0); camera.position.set(center);
private void setBlocked() { for (int i = 0; i < this.map.getLayers().getCount(); i++) { TiledMapTileLayer layer = (TiledMapTileLayer) this.map.getLayers() .get(i); for (int y = 0; y < layer.getHeight(); y++) { for (int x = 0; x < layer.getWidth(); x++) { if (layer.getCell(x, y) != null && layer.getCell(x, y).getTile().getProperties() .containsKey("blocked")) { this.mapArray[x][y] = Config.CANTMOVEONPOSITION; } } } } }
final float color = Color.toFloatBits(batchColor.r, batchColor.g, batchColor.b, batchColor.a * layer.getOpacity()); final int layerWidth = layer.getWidth(); final int layerHeight = layer.getHeight();
final float color = Color.toFloatBits(batchColor.r, batchColor.g, batchColor.b, batchColor.a * layer.getOpacity()); final int layerWidth = layer.getWidth(); final int layerHeight = layer.getHeight();
final float color = Color.toFloatBits(batchColor.r, batchColor.g, batchColor.b, batchColor.a * layer.getOpacity()); final int layerWidth = layer.getWidth(); final int layerHeight = layer.getHeight();
final float color = Color.toFloatBits(1, 1, 1, layer.getOpacity()); final int layerWidth = layer.getWidth(); final int layerHeight = layer.getHeight();
float cameraMaxX = layer.getWidth() * layer.getTileWidth() - cameraMinX; float cameraMaxY = layer.getHeight() * layer.getTileHeight() - cameraMinY;
float cameraMaxX = layer.getWidth() * layer.getTileWidth() - cameraMinX; float cameraMaxY = layer.getHeight() * layer.getTileHeight() - cameraMinY;
float cameraMaxX = layer.getWidth() * layer.getTileWidth() * WORLD_TO_SCREEN - cameraMinX; float cameraMaxY = layer.getHeight() * layer.getTileHeight() * WORLD_TO_SCREEN - cameraMinY;