Search in sources :

Example 1 with Barrel

use of com.nyrds.pixeldungeon.levels.objects.Barrel in project pixel-dungeon-remix by NYRDS.

the class WarehousePainter method paint.

public static void paint(Level level, Room room) {
    fill(level, room, Terrain.WALL);
    fill(level, room, 1, Terrain.EMPTY_SP);
    Room.Door entrance = room.entrance();
    entrance.set(Room.Door.Type.HIDDEN);
    for (int i = room.left + 1; i < room.right; i++) {
        for (int j = room.top + 1; j < room.bottom; j++) {
            if (Math.random() < 0.5) {
                level.addLevelObject(new Barrel(level.cell(i, j)));
            } else {
                Item prize = Random.oneOf(Generator.random(Generator.Category.BULLETS), Generator.random(Generator.Category.THROWABLE));
                level.drop(prize, level.cell(i, j));
            }
        }
    }
}
Also used : Item(com.watabou.pixeldungeon.items.Item) Barrel(com.nyrds.pixeldungeon.levels.objects.Barrel) Room(com.watabou.pixeldungeon.levels.Room)

Aggregations

Barrel (com.nyrds.pixeldungeon.levels.objects.Barrel)1 Item (com.watabou.pixeldungeon.items.Item)1 Room (com.watabou.pixeldungeon.levels.Room)1