• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java CavesBossLevel类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中com.watabou.pixeldungeon.levels.CavesBossLevel的典型用法代码示例。如果您正苦于以下问题:Java CavesBossLevel类的具体用法?Java CavesBossLevel怎么用?Java CavesBossLevel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

CavesBossLevel类属于com.watabou.pixeldungeon.levels包,在下文中一共展示了CavesBossLevel类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: initLevelsMap

点赞 2

import com.watabou.pixeldungeon.levels.CavesBossLevel; //导入依赖的package包/类
private static void initLevelsMap() {
	if (BuildConfig.DEBUG) {
		mDungeonMap = JsonHelper.readJsonFromAsset("levelsDesc/Dungeon_debug.json");
	} else {
		mDungeonMap = JsonHelper.readJsonFromAsset("levelsDesc/Dungeon.json");
	}

	try {
		mLevels = mDungeonMap.getJSONObject("Levels");
		mGraph = mDungeonMap.getJSONObject("Graph");
	} catch (JSONException e) {
		throw new TrackedRuntimeException(e);
	}

	mLevelKindList = new HashMap<>();

	registerLevelClass(SewerLevel.class);
	registerLevelClass(SewerBossLevel.class);
	registerLevelClass(SpiderLevel.class);
	registerLevelClass(PrisonLevel.class);
	registerLevelClass(PrisonBossLevel.class);
	registerLevelClass(CavesLevel.class);
	registerLevelClass(CavesBossLevel.class);
	registerLevelClass(CityLevel.class);
	registerLevelClass(CityBossLevel.class);
	registerLevelClass(LastShopLevel.class);
	registerLevelClass(HallsLevel.class);
	registerLevelClass(HallsBossLevel.class);
	registerLevelClass(LastLevel.class);
	registerLevelClass(DeadEndLevel.class);

	registerLevelClass(PredesignedLevel.class);
	registerLevelClass(GutsLevel.class);
	registerLevelClass(ShadowLordLevel.class);
	registerLevelClass(FakeLastLevel.class);

	registerLevelClass(NecroLevel.class);
	registerLevelClass(NecroBossLevel.class);

	registerLevelClass(IceCavesLevel.class);
	registerLevelClass(IceCavesBossLevel.class);
	registerLevelClass(RandomLevel.class);
	registerLevelClass(TownShopLevel.class);

}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:46,
代码来源:DungeonGenerator.java

示例2: execute

点赞 2

import com.watabou.pixeldungeon.levels.CavesBossLevel; //导入依赖的package包/类
@Override
public void execute( final Hero hero, String action ) {
	
	if (action.equals(AC_MINE)) {
		
		if (!(Dungeon.level instanceof CavesLevel || Dungeon.level instanceof CavesBossLevel) ) {
			GLog.w( TXT_NO_VEIN );
			return;
		}
		
		for (int i=0; i < Level.NEIGHBOURS8.length; i++) {
			
			final int pos = hero.getPos() + Level.NEIGHBOURS8[i];
			if (Dungeon.level.map[pos] == Terrain.WALL_DECO) {
			
				hero.spend( TIME_TO_MINE );
				hero.busy();
				
				hero.getSprite().attack( pos, new Callback() {
					
					@Override
					public void call() {

						CellEmitter.center( pos ).burst( Speck.factory( Speck.STAR ), 7 );
						Sample.INSTANCE.play( Assets.SND_EVOKE );
						
						Dungeon.level.set( pos, Terrain.WALL );
						GameScene.updateMap( pos );
						
						DarkGold gold = new DarkGold();
						if (gold.doPickUp( Dungeon.hero )) {
							GLog.i( Hero.TXT_YOU_NOW_HAVE, gold.name() );
						} else {
							Dungeon.level.drop( gold, hero.getPos() ).sprite.drop();
						}
						
						Hunger hunger = hero.buff( Hunger.class );
						if (hunger != null && !hunger.isStarving()) {
							hunger.satisfy( -Hunger.STARVING / 10 );
							BuffIndicator.refreshHero();
						}
						
						hero.onOperateComplete();
					}
				} );
				
				return;
			}
		}
		
		GLog.w( TXT_NO_VEIN );
		
	} else {
		
		super.execute( hero, action );
		
	}
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:59,
代码来源:Pickaxe.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)