protected void paintWater( Level l, ArrayList<Room> rooms ){ boolean[] lake = Patch.generate( l.width(), l.height(), waterFill, waterSmoothness, true ); if (!rooms.isEmpty()){ for (Room r : rooms){ for (Point p : r.waterPlaceablePoints()){ int i = l.pointToCell(p); if (lake[i] && l.map[i] == Terrain.EMPTY){ l.map[i] = Terrain.WATER; } } } } else { for (int i = 0; i < l.length(); i ++) { if (lake[i] && l.map[i] == Terrain.EMPTY){ l.map[i] = Terrain.WATER; } } } }
protected void paintWater( Level l, ArrayList<Room> rooms ){ boolean[] lake = Patch.generate( l.width(), l.height(), waterFill, waterSmoothness, true ); if (!rooms.isEmpty()){ for (Room r : rooms){ for (Point p : r.waterPlaceablePoints()){ int i = l.pointToCell(p); if (lake[i] && l.map[i] == Terrain.EMPTY){ l.map[i] = Terrain.WATER; } } } } else { for (int i = 0; i < l.length(); i ++) { if (lake[i] && l.map[i] == Terrain.EMPTY){ l.map[i] = Terrain.WATER; } } } }
protected void paintGrass( Level l, ArrayList<Room> rooms ) { boolean[] grass = Patch.generate( l.width(), l.height(), grassFill, grassSmoothness, true );
protected void paintGrass( Level l, ArrayList<Room> rooms ) { boolean[] grass = Patch.generate( l.width(), l.height(), grassFill, grassSmoothness, true );
int eY = Math.min(Dungeon.level.height()-1, c.y + DIST);
int eY = Math.min(Dungeon.level.height()-1, c.y + DIST);
int r = Math.min( x + dist, level.width() - 1 ); int t = Math.max( 0, y - dist ); int b = Math.min( y + dist, level.height() - 1 );
int r = Math.min( x + dist, level.width() - 1 ); int t = Math.max( 0, y - dist ); int b = Math.min( y + dist, level.height() - 1 );
public int screenToTile(int x, int y, boolean wallAssist ) { PointF p = camera().screenToCamera( x, y ). offset( this.point().negate() ). invScale( SIZE ); //snap to the edges of the tilemap p.x = GameMath.gate(0, p.x, Dungeon.level.width()-0.001f); p.y = GameMath.gate(0, p.y, Dungeon.level.height()-0.001f); int cell = (int)p.x + (int)p.y * Dungeon.level.width(); if (wallAssist && map != null && DungeonTileSheet.wallStitcheable(map[cell])){ if (cell + mapWidth < size && p.y % 1 >= 0.75f && !DungeonTileSheet.wallStitcheable(map[cell + mapWidth])){ cell += mapWidth; } } return cell; }
public int screenToTile(int x, int y, boolean wallAssist ) { PointF p = camera().screenToCamera( x, y ). offset( this.point().negate() ). invScale( SIZE ); //snap to the edges of the tilemap p.x = GameMath.gate(0, p.x, Dungeon.level.width()-0.001f); p.y = GameMath.gate(0, p.y, Dungeon.level.height()-0.001f); int cell = (int)p.x + (int)p.y * Dungeon.level.width(); if (wallAssist && map != null && DungeonTileSheet.wallStitcheable(map[cell])){ if (cell + mapWidth < size && p.y % 1 >= 0.75f && !DungeonTileSheet.wallStitcheable(map[cell + mapWidth])){ cell += mapWidth; } } return cell; }
PathFinder.setMapSize(level.width(), level.height());
PathFinder.setMapSize(level.width(), level.height());
PathFinder.setMapSize(level.width(), level.height()); } else { patch = Patch.generate(width()-2, height()-2, fill, clustering, true);
PathFinder.setMapSize(level.width(), level.height()); } else { patch = Patch.generate(width()-2, height()-2, fill, clustering, true);
PathFinder.setMapSize(level.width(), level.height());
PathFinder.setMapSize(level.width(), level.height());