Search in sources :

Example 1 with WellWater

use of com.watabou.pixeldungeon.actors.blobs.WellWater in project pixel-dungeon by watabou.

the class MagicWellPainter method paint.

public static void paint(Level level, Room room) {
    fill(level, room, Terrain.WALL);
    fill(level, room, 1, Terrain.EMPTY);
    Point c = room.center();
    set(level, c.x, c.y, Terrain.WELL);
    @SuppressWarnings("unchecked") Class<? extends WellWater> waterClass = (Class<? extends WellWater>) Random.element(WATERS);
    WellWater water = (WellWater) level.blobs.get(waterClass);
    if (water == null) {
        try {
            water = waterClass.newInstance();
        } catch (Exception e) {
            water = null;
        }
    }
    water.seed(c.x + Level.WIDTH * c.y, 1);
    level.blobs.put(waterClass, water);
    room.entrance().set(Room.Door.Type.REGULAR);
}
Also used : WellWater(com.watabou.pixeldungeon.actors.blobs.WellWater) Point(com.watabou.utils.Point)

Aggregations

WellWater (com.watabou.pixeldungeon.actors.blobs.WellWater)1 Point (com.watabou.utils.Point)1