public void paint( Level level ) { Painter.fill(level, this, 1, Terrain.EMPTY); //true = space, false = wall boolean[][] maze = Maze.generate(this); Painter.fill(level, this, 1, Terrain.EMPTY); for (int x = 0; x < maze.length; x++) for (int y = 0; y < maze[0].length; y++) { if (maze[x][y] == Maze.FILLED) { Painter.fill(level, x + left, y + top, 1, 1, Terrain.WALL); } } }
public void paint( Level level ) { Painter.fill(level, this, 1, Terrain.EMPTY); //true = space, false = wall boolean[][] maze = Maze.generate(this); Painter.fill(level, this, 1, Terrain.EMPTY); for (int x = 0; x < maze.length; x++) for (int y = 0; y < maze[0].length; y++) { if (maze[x][y] == Maze.FILLED) { Painter.fill(level, x + left, y + top, 1, 1, Terrain.WALL); } } }
@Override public void paint(Level level) { Painter.fill( level, this, Terrain.WALL ); Painter.fill( level, this, 1 , Terrain.EMPTY ); int minDim = Math.min(width(), height()); int passageWidth = (int)Math.floor(0.25f*(minDim+1)); Painter.fill(level, this, passageWidth+1, Terrain.WALL); for (Door door : connected.values()) { door.set( Door.Type.REGULAR ); } } }
@Override public void paint(Level level) { Painter.fill( level, this, Terrain.WALL ); Painter.fill( level, this, 1 , Terrain.EMPTY ); int minDim = Math.min(width(), height()); int passageWidth = (int)Math.floor(0.25f*(minDim+1)); Painter.fill(level, this, passageWidth+1, Terrain.WALL); for (Door door : connected.values()) { door.set( Door.Type.REGULAR ); } } }
@Override public void paint( Level level ) { Painter.fill( level, this, Terrain.WALL ); Painter.fill( level, this, 1 , Terrain.EMPTY ); for (Door door : connected.values()) { door.set( Door.Type.REGULAR ); //set door areas to be empty to help with create walls logic Painter.set(level, door, Terrain.EMPTY); } createWalls( level, new Rect(left+1, top+1, right-1, bottom-1)); }
@Override public void paint( Level level ) { Painter.fill( level, this, Terrain.WALL ); Painter.fill( level, this, 1 , Terrain.EMPTY ); for (Door door : connected.values()) { door.set( Door.Type.REGULAR ); //set door areas to be empty to help with create walls logic Painter.set(level, door, Terrain.EMPTY); } createWalls( level, new Rect(left+1, top+1, right-1, bottom-1)); }
@Override public void paint(Level level) { Painter.fill( level, this, Terrain.WALL ); Painter.fill( level, this, 1, Terrain.CHASM ); ArrayList<Rect> platforms = new ArrayList<>(); splitPlatforms( new Rect(left+2, top+2, right-2, bottom-2), platforms); for (Rect platform : platforms){ Painter.fill( level, platform.left, platform.top, platform.width()+1, platform.height()+1, Terrain.EMPTY_SP); } for (Door door : connected.values()) { door.set( Door.Type.REGULAR ); Painter.drawInside(level, this, door, 2, Terrain.EMPTY_SP); } }
@Override public void paint(Level level) { Painter.fill( level, this, Terrain.WALL ); Painter.fill( level, this, 1, Terrain.CHASM ); ArrayList<Rect> platforms = new ArrayList<>(); splitPlatforms( new Rect(left+2, top+2, right-2, bottom-2), platforms); for (Rect platform : platforms){ Painter.fill( level, platform.left, platform.top, platform.width()+1, platform.height()+1, Terrain.EMPTY_SP); } for (Door door : connected.values()) { door.set( Door.Type.REGULAR ); Painter.drawInside(level, this, door, 2, Terrain.EMPTY_SP); } }
public static void fill( Level level, Rect rect, int m, int value ) { fill( level, rect.left + m, rect.top + m, rect.width() - m*2, rect.height() - m*2, value ); }
public static void fill( Level level, Rect rect, int l, int t, int r, int b, int value ) { fill( level, rect.left + l, rect.top + t, rect.width() - (l + r), rect.height() - (t + b), value ); }
public static void fill( Level level, Rect rect, int value ) { fill( level, rect.left, rect.top, rect.width(), rect.height(), value ); }
public void paint( Level level ) { Painter.fill( level, this, Terrain.WALL ); Painter.fill( level, this, 1, Terrain.EMPTY ); Point c = center(); Painter.set( level, c.x, c.y, Terrain.WELL ); @SuppressWarnings("unchecked") Class<? extends WellWater> waterClass = overrideWater != null ? overrideWater : (Class<? extends WellWater>)Random.element( WATERS ); WellWater.seed(c.x + level.width() * c.y, 1, waterClass, level); entrance().set( Door.Type.REGULAR ); } }