当前位置: 首页>>代码示例>>Java>>正文


Java Painter.drawInside方法代码示例

本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter.drawInside方法的典型用法代码示例。如果您正苦于以下问题:Java Painter.drawInside方法的具体用法?Java Painter.drawInside怎么用?Java Painter.drawInside使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter的用法示例。


在下文中一共展示了Painter.drawInside方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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 );
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:18,代码来源:CirclePitRoom.java

示例2: 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);
	}
	
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:21,代码来源:PlatformRoom.java

示例3: 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.TRAP );
		Painter.fill( level, this, 2, Terrain.EMPTY_SP );
		
		for (int i=0; i < 2; i++) {
			int pos;
			do {
				pos = level.pointToCell(random());
			} while (level.map[pos] != Terrain.EMPTY_SP);
			level.drop(
				Generator.random( Random.oneOf(
					Generator.Category.ARMOR,
					Generator.Category.WEAPON
				) ), pos );
		}
		
		for (Door door : connected.values()) {
			door.set( Door.Type.REGULAR );
			Painter.drawInside( level, this, door, 1, Terrain.EMPTY );
		}
		
		Blacksmith npc = new Blacksmith();
		do {
			npc.pos = level.pointToCell(random( 2 ));
		} while (level.heaps.get( npc.pos ) != null);
		level.mobs.add( npc );

		for(Point p : getPoints()) {
			int cell = level.pointToCell(p);
			if (level.map[cell] == Terrain.TRAP){
				level.setTrap(new BurningTrap().reveal(), cell);
			}
		}
	}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:37,代码来源:BlacksmithRoom.java

示例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_SP );
	
	Door entrance = entrance();
	
	Painter.fill( level, left + 1, top+1, width() - 2, 1 , Terrain.BOOKSHELF );
	Painter.drawInside(level, this, entrance, 1, Terrain.EMPTY_SP );
	
	int n = Random.IntRange( 2, 3 );
	for (int i=0; i < n; i++) {
		int pos;
		do {
			pos = level.pointToCell(random());
		} while (level.map[pos] != Terrain.EMPTY_SP || level.heaps.get( pos ) != null);
		Item item;
		if (i == 0)
			item = Random.Int(2) == 0 ? new ScrollOfIdentify() : new ScrollOfRemoveCurse();
		else
			item = prize( level );
		level.drop( item, pos );
	}
	
	entrance.set( Door.Type.LOCKED );
	
	level.addItemToSpawn( new IronKey( Dungeon.depth ) );
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:29,代码来源:LibraryRoom.java

示例5: 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.BOOKSHELF );
	
	Painter.fillEllipse(level, this, 2, Terrain.EMPTY_SP);
	
	Door entrance = entrance();
	if (entrance.x == left || entrance.x == right){
		Painter.drawInside(level, this, entrance, (width() - 3) / 2, Terrain.EMPTY_SP);
	} else {
		Painter.drawInside(level, this, entrance, (height() - 3) / 2, Terrain.EMPTY_SP);
	}
	entrance.set( Door.Type.HIDDEN );
	
	int n = Random.IntRange( 2, 3 );
	HashMap<Class<? extends Scroll>, Float> chances = new HashMap<>(scrollChances);
	for (int i=0; i < n; i++) {
		int pos;
		do {
			pos = level.pointToCell(random());
		} while (level.map[pos] != Terrain.EMPTY_SP || level.heaps.get( pos ) != null);
		
		try{
			Class<?extends Scroll> scrollCls = Random.chances(chances);
			chances.put(scrollCls, 0f);
			level.drop( scrollCls.newInstance(), pos );
		} catch (Exception e){
			ShatteredPixelDungeon.reportException(e);
		}
		
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:34,代码来源:SecretLibraryRoom.java

示例6: 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.BOOKSHELF );
	Painter.fill( level, this, 2 , Terrain.EMPTY_SP );
	
	for (Door door : connected.values()) {
		Painter.drawInside(level, this, door, 2, Terrain.EMPTY_SP);
		door.set( Door.Type.REGULAR );
	}
	
	//TODO add support for giant size as well
	if (sizeCat == SizeCategory.LARGE){
		int pillarW = (width()-7)/2;
		int pillarH = (height()-7)/2;
		
		Painter.fill(level, left+3, top+3, pillarW, 1, Terrain.BOOKSHELF);
		Painter.fill(level, left+3, top+3, 1, pillarH, Terrain.BOOKSHELF);
		
		Painter.fill(level, left+3, bottom-2-1, pillarW, 1, Terrain.BOOKSHELF);
		Painter.fill(level, left+3, bottom-2-pillarH, 1, pillarH, Terrain.BOOKSHELF);
		
		Painter.fill(level, right-2-pillarW, top+3, pillarW, 1, Terrain.BOOKSHELF);
		Painter.fill(level, right-2-1, top+3, 1, pillarH, Terrain.BOOKSHELF);
		
		Painter.fill(level, right-2-pillarW, bottom-2-1, pillarW, 1, Terrain.BOOKSHELF);
		Painter.fill(level, right-2-1, bottom-2-pillarH, 1, pillarH, Terrain.BOOKSHELF);
	}
	
	Point center = center();
	Painter.set( level, center, Terrain.PEDESTAL );
	
	Item prize = (Random.Int(2) == 0) ? level.findPrizeItem() : null;
	
	if (prize != null) {
		level.drop(prize, (center.x + center.y * level.width()));
	} else {
		level.drop(Generator.random( Random.oneOf(
				Generator.Category.POTION,
				Generator.Category.SCROLL)), (center.x + center.y * level.width()));
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:43,代码来源:StudyRoom.java

示例7: paint

import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; //导入方法依赖的package包/类
@Override
public void paint(Level level) {

	int minDim = Math.min(width(), height());

	Painter.fill( level, this, Terrain.WALL );

	if (minDim >= 9) {
		Painter.fillEllipse(level, this, 2, Terrain.EMPTY);
	} else {
		Painter.fill(level, this, 2, 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() - 3) / 2, Terrain.EMPTY);
		} else {
			Painter.drawInside(level, this, door, (height() - 3) / 2, Terrain.EMPTY);
		}
	}

	boolean oddWidth = width() % 2 == 1;
	boolean oddHeight = height() % 2 == 1;

	if (minDim >= 12){

		Painter.fillEllipse(level, this, 5, Terrain.STATUE);
		Painter.fillEllipse(level, this, 6, Terrain.WALL);

	} else {

		Painter.fill(level,
				left + width()/2 + (oddWidth ? 0 : -1),
				top + height()/2 + (oddHeight ? 0 : -1),
				oddWidth ? 1 : 2,
				oddHeight ? 1 : 2,
				Terrain.STATUE);

	}

}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:43,代码来源:SkullsRoom.java


注:本文中的com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter.drawInside方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。