本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter类的典型用法代码示例。如果您正苦于以下问题:Java Painter类的具体用法?Java Painter怎么用?Java Painter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Painter类属于com.shatteredpixel.shatteredpixeldungeon.levels.painters包,在下文中一共展示了Painter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: build
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; //导入依赖的package包/类
@Override
protected boolean build() {
Arrays.fill( map, Terrain.WALL );
Painter.fill( this, 1, 1, SIZE, SIZE, Terrain.WATER );
Painter.fill( this, 2, 2, SIZE-2, SIZE-2, Terrain.EMPTY );
Painter.fill( this, SIZE/2, SIZE/2, 3, 3, Terrain.EMPTY_SP );
entrance = SIZE * WIDTH + SIZE / 2 + 1;
map[entrance] = Terrain.ENTRANCE;
exit = entrance - WIDTH * SIZE;
map[exit] = Terrain.LOCKED_EXIT;
pedestal = (SIZE / 2 + 1) * (WIDTH + 1);
map[pedestal] = Terrain.PEDESTAL;
map[pedestal-1] = map[pedestal+1] = Terrain.STATUE_SP;
feeling = Feeling.NONE;
return true;
}
示例2: paint
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; //导入依赖的package包/类
public void paint(Level level ) {
Painter.fill( level, this, Terrain.WALL );
Painter.fill( level, this, 1, Terrain.EMPTY_SP );
Door entrance = entrance();
entrance.set( Door.Type.HIDDEN );
int door = entrance.x + entrance.y * level.width();
for (int i=left + 1; i < right; i++) {
addChest( level, (top + 1) * level.width() + i, door );
addChest( level, (bottom - 1) * level.width() + i, door );
}
for (int i=top + 2; i < bottom - 1; i++) {
addChest( level, i * level.width() + left + 1, door );
addChest( level, i * level.width() + right - 1, door );
}
RatKing king = new RatKing();
king.pos = level.pointToCell(random( 2 ));
level.mobs.add( king );
}
示例3: paint
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; //导入依赖的package包/类
public void paint( Level level ) {
for (Door door : connected.values()) {
door.set( Door.Type.REGULAR );
}
Painter.fill(level, this, Terrain.WALL);
Painter.fill(level, this, 1, Terrain.EMPTY);
RitualMarker vis = new RitualMarker();
Point c = center();
vis.pos(c.x - 1, c.y - 1);
level.customTiles.add(vis);
Painter.fill(level, c.x-1, c.y-1, 3, 3, Terrain.EMPTY_DECO);
level.addItemToSpawn(new CeremonialCandle());
level.addItemToSpawn(new CeremonialCandle());
level.addItemToSpawn(new CeremonialCandle());
level.addItemToSpawn(new CeremonialCandle());
CeremonialCandle.ritualPos = c.x + (level.width() * c.y);
}
示例4: paint
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; //导入依赖的package包/类
public void paint(Level level ) {
Painter.fill( level, this, Terrain.WALL );
Painter.fill( level, this, 1, Terrain.EMPTY );
Painter.fill( level, left+1, top+1, width()-2, 1, Terrain.WALL_DECO);
Painter.fill( level, left+1, top+2, width()-2, 1, Terrain.WATER);
Painter.set( level, left+width()/2, top+1, Terrain.LOCKED_EXIT);
level.exit = level.pointToCell(new Point(left+width()/2, top+1));
do {
level.entrance = level.pointToCell(random(3));
} while (level.findMob(level.entrance) != null);
Painter.set( level, level.entrance, Terrain.ENTRANCE );
for (Room.Door door : connected.values()) {
door.set( Room.Door.Type.REGULAR );
if (door.y == top){
Painter.set( level, door.x, door.y+1, Terrain.WATER);
}
}
}
示例5: paint
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; //导入依赖的package包/类
@Override
public void paint(Level level) {
Painter.fill( level, this, Terrain.WALL );
Painter.fill( level, this, 1, Terrain.EMPTY );
Painter.fill( level, this, 2, Terrain.EMPTY_SP );
Painter.fill( level, this, 3, Terrain.WATER );
int minDim = Math.min(width(), height());
int numFish = (minDim - 4)/3; //1-3 fish, depending on room size
for (int i=0; i < numFish; i++) {
Piranha piranha = new Piranha();
do {
piranha.pos = level.pointToCell(random(3));
} while (level.map[piranha.pos] != Terrain.WATER|| level.findMob( piranha.pos ) != null);
level.mobs.add( piranha );
}
for (Door door : connected.values()) {
door.set( Door.Type.REGULAR );
}
super.paint(level);
}
示例6: paint
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; //导入依赖的package包/类
@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);
}
}
}
示例7: paint
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; //导入依赖的package包/类
@Override
public void paint(Level level) {
Painter.fill( level, this, Terrain.WALL );
for (Door door : connected.values()) {
door.set( Door.Type.REGULAR );
}
Painter.fill( level, this, 1 , Terrain.GRASS );
int w = width() - 2;
int h = height() - 2;
int nGraves = Math.max( w, h ) / 2;
int index = Random.Int( nGraves );
int shift = Random.Int( 2 );
for (int i=0; i < nGraves; i++) {
int pos = w > h ?
left + 1 + shift + i * 2 + (top + 2 + Random.Int( h-2 )) * level.width() :
(left + 2 + Random.Int( w-2 )) + (top + 1 + shift + i * 2) * level.width();
level.drop( i == index ? Generator.random() : new Gold().random(), pos ).type = Heap.Type.TOMB;
}
}
示例8: paint
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; //导入依赖的package包/类
@Override
public void paint(Level level) {
Painter.fill( level, this, Terrain.WALL );
Painter.fill( level, this, 1, Terrain.EMPTY_SP );
Painter.fill( level, this, 3, Terrain.WATER);
for (Door door : connected.values()) {
door.set( Door.Type.REGULAR );
}
if (Imp.Quest.isCompleted()){
impSpawned = true;
placeItems(level);
placeShopkeeper(level);
} else {
impSpawned = false;
}
}
示例9: paint
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; //导入依赖的package包/类
@Override
public void paint(Level level) {
super.paint(level);
Item i = level.findPrizeItem();
if ( i == null ){
i = new Gold().random();
}
int center = level.pointToCell(center());
Painter.set(level, center, Terrain.PEDESTAL);
if (Random.Int(3) == 0) {
level.drop(i, center).type = Heap.Type.MIMIC;
} else {
level.drop(i, center).type = Heap.Type.CHEST;
}
}
示例10: set
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; //导入依赖的package包/类
public static void set( int cell, int terrain, Level level ) {
Painter.set( level, cell, terrain );
if (terrain != Terrain.TRAP && terrain != Terrain.SECRET_TRAP && terrain != Terrain.INACTIVE_TRAP){
level.traps.remove( cell );
}
int flags = Terrain.flags[terrain];
level.passable[cell] = (flags & Terrain.PASSABLE) != 0;
level.losBlocking[cell] = (flags & Terrain.LOS_BLOCKING) != 0;
level.flamable[cell] = (flags & Terrain.FLAMABLE) != 0;
level.secret[cell] = (flags & Terrain.SECRET) != 0;
level.solid[cell] = (flags & Terrain.SOLID) != 0;
level.avoid[cell] = (flags & Terrain.AVOID) != 0;
level.pit[cell] = (flags & Terrain.PIT) != 0;
level.water[cell] = terrain == Terrain.WATER;
}
示例11: paint
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; //导入依赖的package包/类
@Override
public void paint(Level level) {
Painter.fill( level, this, Terrain.WALL );
Painter.fillEllipse( level, this, 1 , Terrain.EMPTY );
for (Door door : connected.values()) {
door.set( Door.Type.REGULAR );
if (door.x == left || door.x == right){
Painter.drawInside(level, this, door, width()/2, Terrain.EMPTY);
} else {
Painter.drawInside(level, this, door, height()/2, Terrain.EMPTY);
}
}
Painter.fillEllipse( level, this, 3 , Terrain.CHASM );
}
示例12: paint
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; //导入依赖的package包/类
@Override
public void paint(Level level) {
Painter.fill( level, this, Terrain.WALL );
for (Door door : connected.values()) {
door.set( Door.Type.REGULAR );
}
if (sizeCat == SizeCategory.NORMAL) {
Painter.fill(level, this, 1, Terrain.EMPTY_SP);
if (width() > height() || (width() == height() && Random.Int(2) == 0)) {
for (int i = left + 2; i < right; i += 2) {
Painter.fill(level, i, top + 1, 1, height() - 2, Terrain.HIGH_GRASS);
}
} else {
for (int i = top + 2; i < bottom; i += 2) {
Painter.fill(level, left + 1, i, width() - 2, 1, Terrain.HIGH_GRASS);
}
}
} else if (sizeCat == SizeCategory.LARGE){
int layers = (Math.min(width(), height())-1)/2;
for (int i = 1; i <= layers; i++){
Painter.fill(level, this, i, (i % 2 == 1) ? Terrain.EMPTY_SP : Terrain.HIGH_GRASS);
}
}
}
示例13: paint
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; //导入依赖的package包/类
@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);
}
}
示例14: paint
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; //导入依赖的package包/类
public void paint( Level level ) {
final int floor = Terrain.EMPTY_SP;
Painter.fill( level, this, Terrain.WALL );
Painter.fill( level, this, 1, floor );
boolean honeyPot = Random.Int( 2 ) == 0;
int n = Random.IntRange( 3, 4 );
for (int i=0; i < n; i++) {
int pos;
do {
pos = level.pointToCell(random());
} while (level.map[pos] != floor);
if (honeyPot){
level.drop( new Honeypot(), pos);
honeyPot = false;
} else
level.drop( prize( level ), pos );
}
entrance().set( Door.Type.BARRICADE );
level.addItemToSpawn( new PotionOfLiquidFlame() );
}
示例15: paint
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; //导入依赖的package包/类
@Override
public void paint(Level level) {
super.paint(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);
}
}
for (Door door : connected.values()) {
door.set( Door.Type.HIDDEN );
}
}