Search in sources :

Example 1 with Statue

use of com.watabou.pixeldungeon.actors.mobs.Statue in project pixel-dungeon by watabou.

the class StatuePainter 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();
    int cx = c.x;
    int cy = c.y;
    Room.Door door = room.entrance();
    door.set(Room.Door.Type.LOCKED);
    level.addItemToSpawn(new IronKey());
    if (door.x == room.left) {
        fill(level, room.right - 1, room.top + 1, 1, room.height() - 1, Terrain.STATUE);
        cx = room.right - 2;
    } else if (door.x == room.right) {
        fill(level, room.left + 1, room.top + 1, 1, room.height() - 1, Terrain.STATUE);
        cx = room.left + 2;
    } else if (door.y == room.top) {
        fill(level, room.left + 1, room.bottom - 1, room.width() - 1, 1, Terrain.STATUE);
        cy = room.bottom - 2;
    } else if (door.y == room.bottom) {
        fill(level, room.left + 1, room.top + 1, room.width() - 1, 1, Terrain.STATUE);
        cy = room.top + 2;
    }
    Statue statue = new Statue();
    statue.pos = cx + cy * Level.WIDTH;
    level.mobs.add(statue);
    Actor.occupyCell(statue);
}
Also used : Statue(com.watabou.pixeldungeon.actors.mobs.Statue) IronKey(com.watabou.pixeldungeon.items.keys.IronKey) Point(com.watabou.utils.Point) Room(com.watabou.pixeldungeon.levels.Room) Point(com.watabou.utils.Point)

Aggregations

Statue (com.watabou.pixeldungeon.actors.mobs.Statue)1 IronKey (com.watabou.pixeldungeon.items.keys.IronKey)1 Room (com.watabou.pixeldungeon.levels.Room)1 Point (com.watabou.utils.Point)1