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

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

java 3次浏览

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

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

示例1: actDescend

点赞 3

import com.watabou.pixeldungeon.scenes.InterlevelScene; //导入依赖的package包/类
private boolean actDescend( HeroAction.Descend action ) {
	int stairs = action.dst;
	if (pos == stairs && pos == Dungeon.level.exit) {
		
		curAction = null;
		
		Hunger hunger = buff( Hunger.class );
		if (hunger != null && !hunger.isStarving()) {
			hunger.satisfy( -Hunger.STARVING / 10 );
		}
		
		InterlevelScene.mode = InterlevelScene.Mode.DESCEND;
		Game.switchScene( InterlevelScene.class );
		
		return false;
		
	} else if (getCloser( stairs )) {
		
		return true;
		
	} else {
		ready();
		return false;
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:26,
代码来源:Hero.java

示例2: heroFall

点赞 3

import com.watabou.pixeldungeon.scenes.InterlevelScene; //导入依赖的package包/类
public static void heroFall( int pos ) {
	
	jumpConfirmed = false;
			
	Sample.INSTANCE.play( Assets.SND_FALLING );
	
	if (Dungeon.hero.isAlive()) {
		Dungeon.hero.interrupt();
		InterlevelScene.mode = InterlevelScene.Mode.FALL;
		if (Dungeon.level instanceof RegularLevel) {
			Room room = ((RegularLevel)Dungeon.level).room( pos );
			InterlevelScene.fallIntoPit = room != null && room.type == Room.Type.WEAK_FLOOR;
		} else {
			InterlevelScene.fallIntoPit = false;
		}
		Game.switchScene( InterlevelScene.class );
	} else {
		Dungeon.hero.sprite.visible = false;
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:21,
代码来源:Chasm.java

示例3: heroLand

点赞 3

import com.watabou.pixeldungeon.scenes.InterlevelScene; //导入依赖的package包/类
public static void heroLand() {
	
	Hero hero = Dungeon.hero;
	
	hero.getSprite().setVisible(true);
	hero.getSprite().alpha(1f);

	hero.getSprite().burst( hero.getSprite().blood(), 10 );
	Camera.main.shake( 4, 0.2f );
	
	Buff.prolong( hero, Cripple.class, Cripple.DURATION );
	hero.damage( Random.IntRange( hero.ht() / 3, hero.ht() / 2 ), new Hero.Doom() {
		@Override
		public void onDeath() {
			Badges.validateDeathFromFalling();
			
			Dungeon.fail( Utils.format( ResultDescriptions.FALL, Dungeon.depth ) );
			GLog.n(Game.getVar(R.string.Chasm_Info));
		}
	} );
	InterlevelScene.mode = InterlevelScene.Mode.CONTINUE;
}
 

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

示例4: heroFall

点赞 3

import com.watabou.pixeldungeon.scenes.InterlevelScene; //导入依赖的package包/类
private static void heroFall(int pos, Hero hero) {

		jumpConfirmed = false;

		Sample.INSTANCE.play( Assets.SND_FALLING );
		hero.releasePets();

		if (hero.isAlive()) {
			hero.clearActions();
			InterlevelScene.mode = InterlevelScene.Mode.FALL;
			if (Dungeon.level instanceof RegularLevel) {
				Room room = ((RegularLevel)Dungeon.level).room( pos );
				InterlevelScene.fallIntoPit = room != null && room.type == Room.Type.WEAK_FLOOR;
			} else {
				InterlevelScene.fallIntoPit = false;
			}
			Game.switchScene( InterlevelScene.class );
		} else {
			hero.getSprite().setVisible(false);
		}
	}
 

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

示例5: actAscend

点赞 2

import com.watabou.pixeldungeon.scenes.InterlevelScene; //导入依赖的package包/类
private boolean actAscend( HeroAction.Ascend action ) {
	int stairs = action.dst;
	if (pos == stairs && pos == Dungeon.level.entrance) {
		
		if (Dungeon.depth == 1) {
			
			if (belongings.getItem( Amulet.class ) == null) {
				GameScene.show( new WndMessage( TXT_LEAVE ) );
				ready();
			} else {
				Dungeon.win( ResultDescriptions.WIN );
				Dungeon.deleteGame( Dungeon.hero.heroClass, true );
				Game.switchScene( SurfaceScene.class );
			}
			
		} else {
			
			curAction = null;
			
			Hunger hunger = buff( Hunger.class );
			if (hunger != null && !hunger.isStarving()) {
				hunger.satisfy( -Hunger.STARVING / 10 );
			}
			
			InterlevelScene.mode = InterlevelScene.Mode.ASCEND;
			Game.switchScene( InterlevelScene.class );
		}
		
		return false;
		
	} else if (getCloser( stairs )) {
		
		return true;
		
	} else {
		ready();
		return false;
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:40,
代码来源:Hero.java

示例6: loadGame

点赞 2

import com.watabou.pixeldungeon.scenes.InterlevelScene; //导入依赖的package包/类
public static void loadGame(String slot, HeroClass heroClass) {
	
	GLog.toFile("Loading: class :%s slot: %s", heroClass.toString(), slot);
	Dungeon.deleteGame(true);
	copyFromSaveSlot(slot, heroClass);
	
	InterlevelScene.mode = InterlevelScene.Mode.CONTINUE;
	Game.switchScene(InterlevelScene.class);
	Dungeon.heroClass = heroClass;
}
 

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

示例7: onSurfaceChanged

点赞 2

import com.watabou.pixeldungeon.scenes.InterlevelScene; //导入依赖的package包/类
@Override
public void onSurfaceChanged(GL10 gl, int width, int height) {
	super.onSurfaceChanged(gl, width, height);

	if (needSceneRestart && !(scene instanceof InterlevelScene)) {
		requestedReset = true;
		setNeedSceneRestart(false);
	}
}
 

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

示例8: WndResurrect

点赞 2

import com.watabou.pixeldungeon.scenes.InterlevelScene; //导入依赖的package包/类
public WndResurrect( final Ankh ankh, Object causeOfDeath ) {
	
	super();
	
	instance = this;
	WndResurrect.causeOfDeath = causeOfDeath;
	
	IconTitle titlebar = new IconTitle();
	titlebar.icon( new ItemSprite( ankh.image(), null ) );
	titlebar.label( ankh.name() );
	titlebar.setRect( 0, 0, WIDTH, 0 );
	add( titlebar );
	
	BitmapTextMultiline message = PixelScene.createMultiline( TXT_MESSAGE, 6 );
	message.maxWidth = WIDTH;
	message.measure();
	message.y = titlebar.bottom() + GAP;
	add( message );
	
	RedButton btnYes = new RedButton( TXT_YES ) {
		@Override
		protected void onClick() {
			hide();
			
			Statistics.ankhsUsed++;
			
			InterlevelScene.mode = InterlevelScene.Mode.RESURRECT;
			Game.switchScene( InterlevelScene.class );
		}
	};
	btnYes.setRect( 0, message.y + message.height() + GAP, WIDTH, BTN_HEIGHT );
	add( btnYes );
	
	RedButton btnNo = new RedButton( TXT_NO ) {
		@Override
		protected void onClick() {
			hide();
			
			Rankings.INSTANCE.submit( false );
			Hero.reallyDie( WndResurrect.causeOfDeath );
		}
	};
	btnNo.setRect( 0, btnYes.bottom() + GAP, WIDTH, BTN_HEIGHT );
	add( btnNo );
	
	resize( WIDTH, (int)btnNo.bottom() );
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:48,
代码来源:WndResurrect.java

示例9: WndGame

点赞 2

import com.watabou.pixeldungeon.scenes.InterlevelScene; //导入依赖的package包/类
public WndGame() {
	
	super();
	
	addButton( new RedButton( TXT_SETTINGS ) {
		@Override
		protected void onClick() {
			hide();
			GameScene.show( new WndSettings( true ) );
		}
	} );
	
	if (Dungeon.challenges > 0) {
		addButton( new RedButton( TXT_CHALLEGES ) {
			@Override
			protected void onClick() {
				hide();
				GameScene.show( new WndChallenges( Dungeon.challenges, false ) );
			}
		} );
	}
	
	if (!Dungeon.hero.isAlive()) {
		
		RedButton btnStart;
		addButton( btnStart = new RedButton( TXT_START ) {
			@Override
			protected void onClick() {
				Dungeon.hero = null;
				PixelDungeon.challenges( Dungeon.challenges );
				InterlevelScene.mode = InterlevelScene.Mode.DESCEND;
				InterlevelScene.noStory = true;
				Game.switchScene( InterlevelScene.class );
			}
		} );
		btnStart.icon( Icons.get( Dungeon.hero.heroClass ) );
		
		addButton( new RedButton( TXT_RANKINGS ) {
			@Override
			protected void onClick() {
				InterlevelScene.mode = InterlevelScene.Mode.DESCEND;
				Game.switchScene( RankingsScene.class );
			}
		} );
	}
			
	addButtons( 
		new RedButton( TXT_MENU ) {
			@Override
			protected void onClick() {
				try {
					Dungeon.saveAll();
				} catch (IOException e) {
					// Do nothing
				}
				Game.switchScene( TitleScene.class );
			}
		}, new RedButton( TXT_EXIT ) {
			@Override
			protected void onClick() {
				Game.instance.finish();
			}
		} 
	);
	
	addButton( new RedButton( TXT_RETURN ) {
		@Override
		protected void onClick() {
			hide();
		}
	} );
	
	resize( WIDTH, pos );
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:75,
代码来源:WndGame.java

示例10: execute

点赞 2

import com.watabou.pixeldungeon.scenes.InterlevelScene; //导入依赖的package包/类
@Override
public void execute( Hero hero, String action ) {
	
	if (action == AC_SET || action == AC_RETURN) {
		
		if (Dungeon.bossLevel()) {
			hero.spend( LloydsBeacon.TIME_TO_USE );
			GLog.w( TXT_PREVENTING );
			return;
		}
		
		for (int i=0; i < Level.NEIGHBOURS8.length; i++) {
			if (Actor.findChar( hero.pos + Level.NEIGHBOURS8[i] ) != null) {
				GLog.w( TXT_CREATURES );
				return;
			}
		}
	}
	
	if (action == AC_SET) {
		
		returnDepth = Dungeon.depth;
		returnPos = hero.pos;
		
		hero.spend( LloydsBeacon.TIME_TO_USE );
		hero.busy();
		
		hero.sprite.operate( hero.pos );
		Sample.INSTANCE.play( Assets.SND_BEACON );
		
		GLog.i( TXT_RETURN );
		
	} else if (action == AC_RETURN) {
		
		if (returnDepth == Dungeon.depth) {
			reset();
			WandOfBlink.appear( hero, returnPos );
			Dungeon.level.press( returnPos, hero );
			Dungeon.observe();
		} else {
			InterlevelScene.mode = InterlevelScene.Mode.RETURN;
			InterlevelScene.returnDepth = returnDepth;
			InterlevelScene.returnPos = returnPos;
			reset();
			Game.switchScene( InterlevelScene.class );
		}
		
		
	} else {
		
		super.execute( hero, action );
		
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:55,
代码来源:LloydsBeacon.java

示例11: WndPortal

点赞 2

import com.watabou.pixeldungeon.scenes.InterlevelScene; //导入依赖的package包/类
public WndPortal(final PortalGate portal, final Hero hero, final Position returnTo ) {
	super();

	//Title text
	Text tfTitle = PixelScene.createMultiline(Game.getVar(R.string.WndPortal_Title), GuiProperties.mediumTitleFontSize());
	tfTitle.hardlight(TITLE_COLOR);
	tfTitle.maxWidth(WIDTH - GAP);
	tfTitle.measure();
	tfTitle.x = (WIDTH - tfTitle.width())/2;
	tfTitle.y = GAP;
	add(tfTitle);

	//Instruction text
	Text message = PixelScene.createMultiline(getDesc(), GuiProperties.regularFontSize() );
	message.maxWidth(WIDTH);
	message.measure();
	message.y = tfTitle.bottom()+ GAP;
	add( message );

	//Yes Button
	TextButton btnYes = new RedButton(Game.getVar(R.string.Wnd_Button_Yes)) {
		@Override
		protected void onClick() {
			super.onClick();
			hide();
			portal.useUp();

			hero.setPortalLevelCoordinates(Dungeon.currentPosition());
			InterlevelScene.mode = InterlevelScene.Mode.RETURN;
			InterlevelScene.returnTo = new Position(returnTo);
			Game.switchScene( InterlevelScene.class );
		}
	};

	btnYes.setRect(0, message.bottom() + GAP, WIDTH, BTN_HEIGHT);
	add(btnYes);

	//No Button
	TextButton btnNo = new RedButton(Game.getVar(R.string.Wnd_Button_No)) {
		@Override
		protected void onClick() {
			super.onClick();
			hide();
		}
	};

	btnNo.setRect(0, btnYes.bottom() + GAP, WIDTH, BTN_HEIGHT);
	add(btnNo);

	resize( WIDTH, (int) btnNo.bottom() + BTN_HEIGHT / 2);
}
 

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

示例12: actAscend

点赞 2

import com.watabou.pixeldungeon.scenes.InterlevelScene; //导入依赖的package包/类
private boolean actAscend(HeroAction.Ascend action) {
	refreshPets();

	int stairs = action.dst;
	if (getPos() == stairs && getPos() == Dungeon.level.entrance) {

		Position nextLevel = DungeonGenerator.ascend(Dungeon.currentPosition());

		if (nextLevel.levelId.equals("0")) {

			if (belongings.getItem(Amulet.class) == null) {
				GameScene.show(new WndMessage(TXT_LEAVE));
				ready();
			} else {
				Dungeon.win(ResultDescriptions.WIN, Rankings.gameOver.WIN_HAPPY);

				Dungeon.gameOver();

				Game.switchScene(SurfaceScene.class);
			}

		} else {

			clearActions();

			Hunger hunger = buff(Hunger.class);
			if (hunger != null && !hunger.isStarving() && !Dungeon.level.isSafe()) {
				hunger.satisfy(-Hunger.STARVING / 10);
			}

			InterlevelScene.mode = InterlevelScene.Mode.ASCEND;
			Game.switchScene(InterlevelScene.class);
		}

		return false;

	} else if (getCloser(stairs)) {

		return true;

	} else {
		ready();
		return false;
	}
}
 

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

示例13: WndResurrect

点赞 2

import com.watabou.pixeldungeon.scenes.InterlevelScene; //导入依赖的package包/类
public WndResurrect( final Ankh ankh, Object causeOfDeath ) {
	super();
	
	instance = this;
	WndResurrect.causeOfDeath = causeOfDeath;
	
	IconTitle titlebar = new IconTitle();
	if (ankh != null){
		titlebar.icon( new ItemSprite( ankh ) );
		titlebar.label( ankh.name() );
	} else {
		titlebar.icon( new ItemSprite( new BlackSkull()) );
		titlebar.label( Utils.capitalize( Game.getVar(R.string.Necromancy_Title) ) );
	}

	titlebar.setRect( 0, 0, WIDTH, 0 );
	add( titlebar );
	
	Text message = PixelScene.createMultiline( TXT_MESSAGE, GuiProperties.regularFontSize() );
	message.maxWidth(WIDTH);
	message.measure();
	message.y = titlebar.bottom() + GAP;
	add( message );
	
	RedButton btnYes = new RedButton( TXT_YES ) {
		@Override
		protected void onClick() {
			hide();
			
			Statistics.ankhsUsed++;
			
			InterlevelScene.mode = InterlevelScene.Mode.RESURRECT;
			Game.switchScene( InterlevelScene.class );
		}
	};
	btnYes.setRect( 0, message.y + message.height() + GAP, WIDTH, BTN_HEIGHT );
	add( btnYes );
	
	RedButton btnNo = new RedButton( TXT_NO ) {
		@Override
		protected void onClick() {
			hide();
			Hero.reallyDie( WndResurrect.causeOfDeath );
		}
	};
	btnNo.setRect( 0, btnYes.bottom() + GAP, WIDTH, BTN_HEIGHT );
	add( btnNo );
	
	resize( WIDTH, (int)btnNo.bottom() );
}
 

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

示例14: execute

点赞 2

import com.watabou.pixeldungeon.scenes.InterlevelScene; //导入依赖的package包/类
@Override
public void execute( Hero hero, String action ) {
	
	if (action.equals(AC_SET) || action.equals(AC_RETURN)) {
		
		if (Dungeon.bossLevel()) {
			hero.spend( LloydsBeacon.TIME_TO_USE );
			GLog.w( TXT_PREVENTING );
			return;
		}
		
		for (int i=0; i < Level.NEIGHBOURS8.length; i++) {
			if (Actor.findChar( hero.getPos() + Level.NEIGHBOURS8[i] ) != null) {
				GLog.w( TXT_CREATURES );
				return;
			}
		}
	}
	
	if (action.equals(AC_SET)) {
		
		returnTo = Dungeon.currentPosition();
		
		hero.spend( LloydsBeacon.TIME_TO_USE );
		hero.busy();
		
		hero.getSprite().operate( hero.getPos() );
		Sample.INSTANCE.play( Assets.SND_BEACON );
		
		GLog.i( TXT_RETURN );
		
	} else if (action.equals(AC_RETURN)) {
		if (returnTo.levelId.equals(Dungeon.level.levelId)) {
			WandOfBlink.appear( hero, returnTo.cellId );
			Dungeon.level.press( returnTo.cellId, hero );
			reset();
			Dungeon.observe();
		} else {
			InterlevelScene.mode = InterlevelScene.Mode.RETURN;
			InterlevelScene.returnTo = new Position(returnTo);
			reset();
			Game.switchScene( InterlevelScene.class );
		}
	} else {
		
		super.execute( hero, action );
		
	}
}
 

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

示例15: actDescend

点赞 1

import com.watabou.pixeldungeon.scenes.InterlevelScene; //导入依赖的package包/类
private boolean actDescend(HeroAction.Descend action) {

		refreshPets();

		int stairs = action.dst;
		if (getPos() == stairs && Dungeon.level.isExit(getPos())) {

			Dungeon.level.onHeroDescend(getPos());

			clearActions();

			Hunger hunger = buff(Hunger.class);
			if (hunger != null && !hunger.isStarving() && !Dungeon.level.isSafe()) {
				hunger.satisfy(-Hunger.STARVING / 10);
			}

			InterlevelScene.mode = InterlevelScene.Mode.DESCEND;
			Game.switchScene(InterlevelScene.class);

			return false;

		} else if (getCloser(stairs)) {

			return true;

		} else {
			ready();
			return false;
		}
	}
 

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


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