@Override public void paint(Level level) { super.paint(level); int floor = level.tunnelTile(); Rect ring = getConnectionSpace(); Painter.fill( level, ring.left, ring.top, 3, 3, floor); Painter.fill( level, ring.left+1, ring.top+1, 1, 1, Terrain.WALL); }
@Override protected Rect getConnectionSpace() { if (connSpace == null) { Point c = getDoorCenter(); c.x = (int) GameMath.gate(left + 2, c.x, right - 2); c.y = (int) GameMath.gate(top + 2, c.y, bottom - 2); connSpace = new Rect(c.x-1, c.y-1, c.x+1, c.y+1); } return connSpace; } }
@Override public void paint(Level level) { Painter.fill(level, this, 1, Terrain.CHASM); super.paint(level); for (Room r : neigbours){ if (r instanceof BridgeRoom || r instanceof RingBridgeRoom || r instanceof WalkwayRoom){ Rect i = intersect(r); if (i.width() != 0){ i.left++; i.right--; } else { i.top++; i.bottom--; } Painter.fill(level, i.left, i.top, i.width()+1, i.height()+1, Terrain.CHASM); } } } }
@Override public void paint(Level level) { Painter.fill(level, this, 1, Terrain.CHASM); super.paint(level); for (Room r : neigbours){ if (r instanceof BridgeRoom || r instanceof RingBridgeRoom || r instanceof WalkwayRoom){ Rect i = intersect(r); if (i.width() != 0){ i.left++; i.right--; } else { i.top++; i.bottom--; } Painter.fill(level, i.left, i.top, i.width()+1, i.height()+1, Terrain.CHASM); } } } }
@Override protected Rect getConnectionSpace() { if (connSpace == null) { Point c = getDoorCenter(); c.x = (int) GameMath.gate(left + 2, c.x, right - 2); c.y = (int) GameMath.gate(top + 2, c.y, bottom - 2); connSpace = new Rect(c.x-1, c.y-1, c.x+1, c.y+1); } return connSpace; } }
@Override public void paint(Level level) { super.paint(level); int floor = level.tunnelTile(); Rect ring = getConnectionSpace(); Painter.fill( level, ring.left, ring.top, 3, 3, floor); Painter.fill( level, ring.left+1, ring.top+1, 1, 1, Terrain.WALL); }