當前位置: 首頁>>代碼示例>>Java>>正文


Java WndHero類代碼示例

本文整理匯總了Java中com.shatteredpixel.shatteredpixeldungeon.windows.WndHero的典型用法代碼示例。如果您正苦於以下問題:Java WndHero類的具體用法?Java WndHero怎麽用?Java WndHero使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


WndHero類屬於com.shatteredpixel.shatteredpixeldungeon.windows包,在下文中一共展示了WndHero類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: examineObject

import com.shatteredpixel.shatteredpixeldungeon.windows.WndHero; //導入依賴的package包/類
public static void examineObject(Object o){
	if (o == Dungeon.hero){
		GameScene.show( new WndHero() );
	} else if ( o instanceof Mob ){
		GameScene.show(new WndInfoMob((Mob) o));
	} else if ( o instanceof Heap ){
		Heap heap = (Heap)o;
		if (heap.type == Heap.Type.FOR_SALE && heap.size() == 1 && heap.peek().price() > 0) {
			GameScene.show(new WndTradeItem(heap, false));
		} else {
			GameScene.show(new WndInfoItem(heap));
		}
	} else if ( o instanceof Plant ){
		GameScene.show( new WndInfoPlant((Plant) o) );
	} else if ( o instanceof Trap ){
		GameScene.show( new WndInfoTrap((Trap) o));
	} else {
		GameScene.show( new WndMessage( Messages.get(GameScene.class, "dont_know") ) ) ;
	}
}
 
開發者ID:00-Evan,項目名稱:shattered-pixel-dungeon,代碼行數:21,代碼來源:GameScene.java

示例2: onSelect

import com.shatteredpixel.shatteredpixeldungeon.windows.WndHero; //導入依賴的package包/類
@Override
public void onSelect( Integer cell ) {
	
	if (cell == null) {
		return;
	}
	
	if (cell < 0 || cell > Level.LENGTH || (!Dungeon.level.visited[cell] && !Dungeon.level.mapped[cell])) {
		GameScene.show( new WndMessage( "You don't know what is there." ) ) ;
		return;
	}
	
	if (!Dungeon.visible[cell]) {
		GameScene.show( new WndInfoCell( cell ) );
		return;
	}
	
	if (cell == Dungeon.hero.pos) {
		GameScene.show( new WndHero() );
		return;
	}
	
	Mob mob = (Mob)Actor.findChar( cell );
	if (mob != null) {
		GameScene.show( new WndInfoMob( mob ) );
		return;
	}
	
	Heap heap = Dungeon.level.heaps.get( cell );
	if (heap != null) {
		if (heap.type == Heap.Type.FOR_SALE && heap.size() == 1 && heap.peek().price() > 0) {
			GameScene.show( new WndTradeItem( heap, false ) );
		} else {
			GameScene.show( new WndInfoItem( heap ) );
		}
		return;
	}
	
	Plant plant = Dungeon.level.plants.get( cell );
	if (plant != null) {
		GameScene.show( new WndInfoPlant( plant ) );
		return;
	}
	
	GameScene.show( new WndInfoCell( cell ) );
}
 
開發者ID:wolispace,項目名稱:soft-pixel-dungeon,代碼行數:47,代碼來源:Toolbar.java

示例3: createChildren

import com.shatteredpixel.shatteredpixeldungeon.windows.WndHero; //導入依賴的package包/類
@Override
protected void createChildren() {

    shield = new NinePatch( Assets.STATUS, 80, 0, 30   + 18, 0 );
    add( shield );

    add( new TouchArea( 0, 1, 30, 30 ) {
        @Override
        protected void onClick( Touch touch ) {
            Image sprite = Dungeon.hero.sprite;
            if (!sprite.isVisible()) {
                Camera.main.focusOn( sprite );
            }
            GameScene.show( new WndHero() );
        };
    } );

    btnMenu = new MenuButton();
    add( btnMenu );

    avatar = HeroSprite.avatar( Dungeon.hero.heroClass, lastTier );
    add( avatar );

    blood = new Emitter();
    blood.pos( avatar );
    blood.pour( BloodParticle.FACTORY, 0.3f );
    blood.autoKill = false;
    blood.on = false;
    add( blood );

    compass = new Compass( Dungeon.level.exit );
    add( compass );

    hp = new Image( Assets.HP_BAR );
    add( hp );

    exp = new Image( Assets.XP_BAR );
    add( exp );

    level = new BitmapText( PixelScene.font1x );
    level.hardlight( 0xFFEBA4 );
    add( level );

    depth = new BitmapText( Integer.toString( Dungeon.depth ), PixelScene.font1x );
    depth.hardlight( 0xCACFC2 );
    depth.measure();
    add( depth );

    Dungeon.hero.belongings.countIronKeys();
    keys = new BitmapText( PixelScene.font1x );
    keys.hardlight( 0xCACFC2 );
    add( keys );

    danger = new DangerIndicator();
    add( danger );

    resume = new ResumeIndicator();
    add ( resume );

    loot = new LootIndicator();
    add( loot );

    buffs = new BuffIndicator( Dungeon.hero );
    add( buffs );
}
 
開發者ID:wolispace,項目名稱:soft-pixel-dungeon,代碼行數:66,代碼來源:StatusPane.java

示例4: createChildren

import com.shatteredpixel.shatteredpixeldungeon.windows.WndHero; //導入依賴的package包/類
@Override
protected void createChildren() {

	bg = new NinePatch( Assets.STATUS, 0, 0, 128, 36, 85, 0, 45, 0 );
	add( bg );

	add( new TouchArea( 0, 1, 31, 31 ) {
		@Override
		protected void onClick( Touch touch ) {
			Image sprite = Dungeon.hero.sprite;
			if (!sprite.isVisible()) {
				Camera.main.focusOn( sprite );
			}
			GameScene.show( new WndHero() );
		}
	} );

	btnJournal = new JournalButton();
	add( btnJournal );

	btnMenu = new MenuButton();
	add( btnMenu );

	avatar = HeroSprite.avatar( Dungeon.hero.heroClass, lastTier );
	add( avatar );

	compass = new Compass( Statistics.amuletObtained ? Dungeon.level.entrance : Dungeon.level.exit );
	add( compass );

	rawShielding = new Image( Assets.SHLD_BAR );
	rawShielding.alpha(0.5f);
	add(rawShielding);

	shieldedHP = new Image( Assets.SHLD_BAR );
	add(shieldedHP);

	hp = new Image( Assets.HP_BAR );
	add( hp );

	exp = new Image( Assets.XP_BAR );
	add( exp );

	bossHP = new BossHealthBar();
	add( bossHP );

	level = new BitmapText( PixelScene.pixelFont);
	level.hardlight( 0xFFEBA4 );
	add( level );

	depth = new BitmapText( Integer.toString( Dungeon.depth ), PixelScene.pixelFont);
	depth.hardlight( 0xCACFC2 );
	depth.measure();
	add( depth );

	danger = new DangerIndicator();
	add( danger );

	buffs = new BuffIndicator( Dungeon.hero );
	add( buffs );

	add( pickedUp = new Toolbar.PickedUpItem());
}
 
開發者ID:00-Evan,項目名稱:shattered-pixel-dungeon,代碼行數:63,代碼來源:StatusPane.java

示例5: createChildren

import com.shatteredpixel.shatteredpixeldungeon.windows.WndHero; //導入依賴的package包/類
@Override
protected void createChildren() {

	bg = new NinePatch( Assets.STATUS, 0, 0, 128, 36, 85, 0, 45, 0 );
	add( bg );

	add( new TouchArea<GameAction>( 0, 1, 31, 31 ) {
		@Override
		protected void onClick( NoosaInputProcessor.Touch touch ) {
			Image sprite = Dungeon.hero.sprite;
			if (!sprite.isVisible()) {
				Camera.main.focusOn( sprite );
			}
			GameScene.show( new WndHero() );
		}

		@Override
		public boolean onKeyUp(NoosaInputProcessor.Key<GameAction> key) {
			boolean handled = true;
			switch (key.action) {
			case HERO_INFO:
				onClick( null );
				break;
			case JOURNAL:
				GameScene.show( new WndJournal() );
				break;
			default:
				handled = false;
				break;
			}
			return handled;
		}
	} );

	btnJournal = new JournalButton();
	add( btnJournal );

	btnMenu = new MenuButton();
	add( btnMenu );

	avatar = HeroSprite.avatar( Dungeon.hero.heroClass, lastTier );
	add( avatar );

	compass = new Compass( Statistics.amuletObtained ? Dungeon.level.entrance : Dungeon.level.exit );
	add( compass );

	rawShielding = new Image( Assets.SHLD_BAR );
	rawShielding.alpha(0.5f);
	add(rawShielding);

	shieldedHP = new Image( Assets.SHLD_BAR );
	add(shieldedHP);

	hp = new Image( Assets.HP_BAR );
	add( hp );

	exp = new Image( Assets.XP_BAR );
	add( exp );

	bossHP = new BossHealthBar();
	add( bossHP );

	level = new BitmapText( PixelScene.pixelFont);
	level.hardlight( 0xFFEBA4 );
	add( level );

	depth = new BitmapText( Integer.toString( Dungeon.depth ), PixelScene.pixelFont);
	depth.hardlight( 0xCACFC2 );
	depth.measure();
	add( depth );

	danger = new DangerIndicator();
	add( danger );

	buffs = new BuffIndicator( Dungeon.hero );
	add( buffs );

	add( pickedUp = new Toolbar.PickedUpItem());
}
 
開發者ID:00-Evan,項目名稱:shattered-pixel-dungeon-gdx,代碼行數:80,代碼來源:StatusPane.java


注:本文中的com.shatteredpixel.shatteredpixeldungeon.windows.WndHero類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。