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

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

java 2次浏览

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

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

示例1: die

点赞 3

import com.watabou.pixeldungeon.effects.Flare; //导入依赖的package包/类
@Override
public void die( Object cause  ) {
	
	curAction = null;
	
	DewVial.autoDrink( this );
	if (isAlive()) {
		new Flare( 8, 32 ).color( 0xFFFF66, true ).show( sprite, 2f ) ;
		return;
	}
	
	Actor.fixTime();
	super.die( cause );
	
	Ankh ankh = (Ankh)belongings.getItem( Ankh.class );
	if (ankh == null) {
		
		reallyDie( cause );
		
	} else {
		
		Dungeon.deleteGame( Dungeon.hero.heroClass, false );
		GameScene.show( new WndResurrect( ankh, cause ) );
		
	}
}
 

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

示例2: add

点赞 3

import com.watabou.pixeldungeon.effects.Flare; //导入依赖的package包/类
@Override
public void add( Buff buff ) {
	super.add( buff );
	if (buff instanceof Amok) {
		if (sprite != null) {
			sprite.showStatus( CharSprite.NEGATIVE, TXT_RAGE );
		}
		state = HUNTING;
	} else if (buff instanceof Terror) {
		state = FLEEING;
	} else if (buff instanceof Sleep) {
		if (sprite != null) {
			new Flare( 4, 32 ).color( 0x44ffff, true ).show( sprite, 2f ) ;
		}
		state = SLEEPEING;
		postpone( Sleep.SWS );
	}
}
 

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

示例3: doRead

点赞 3

import com.watabou.pixeldungeon.effects.Flare; //导入依赖的package包/类
@Override
protected void doRead() {
	
	new Flare( 6, 32 ).show( curUser.sprite, 2f ) ;
	Sample.INSTANCE.play( Assets.SND_READ );
	Invisibility.dispel();
	
	boolean procced = uncurse( curUser, curUser.belongings.backpack.items.toArray( new Item[0] ) ); 
	procced = uncurse( curUser, 
		curUser.belongings.weapon, 
		curUser.belongings.armor, 
		curUser.belongings.ring1, 
		curUser.belongings.ring2 ) || procced;
	
	Weakness.detach( curUser, Weakness.class );
	
	if (procced) {
		GLog.p( TXT_PROCCED );			
	} else {		
		GLog.i( TXT_NOT_PROCCED );		
	}
	
	setKnown();
	
	readAnimation();
}
 

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

示例4: doRead

点赞 3

import com.watabou.pixeldungeon.effects.Flare; //导入依赖的package包/类
@Override
protected void doRead() {
	
	new Flare( 6, 32 ).show( curUser.sprite, 2f ) ;
	Sample.INSTANCE.play( Assets.SND_READ );
	Invisibility.dispel();
	
	boolean procced = uncurse( curUser, curUser.belongings.backpack.items.toArray( new Item[0] ) ); 
	procced = uncurse( curUser, 
		curUser.belongings.weapon, 
		curUser.belongings.armor, 
		curUser.belongings.ring1, 
		curUser.belongings.ring2 ) || procced;
	
	Weakness.detach( curUser, Weakness.class );
	
	if (procced) {
		GLog.p( TXT_PROCCED );			
	} else {		
		GLog.i( TXT_NOT_PROCCED );		
	}
	
	setKnown();
	
	curUser.spendAndNext( TIME_TO_READ );
}
 

开发者ID:skynet67,
项目名称:pixel-dungeon-rebirth,
代码行数:27,
代码来源:ScrollOfRemoveCurse.java

示例5: add

点赞 3

import com.watabou.pixeldungeon.effects.Flare; //导入依赖的package包/类
@Override
public void add(Buff buff) {
	super.add(buff);

	if (!GameScene.isSceneReady()) {
		return;
	}

	if (buff instanceof Amok) {
		getSprite().showStatus(CharSprite.NEGATIVE, TXT_RAGE);
		setState(HUNTING);
	} else if (buff instanceof Terror) {
		setState(FLEEING);
	} else if (buff instanceof Sleep) {
		new Flare(4, 32).color(0x44ffff, true).show(getSprite(), 2f);
		setState(SLEEPING);
		postpone(Sleep.SWS);
	}
}
 

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

示例6: summon

点赞 3

import com.watabou.pixeldungeon.effects.Flare; //导入依赖的package包/类
private void summon() {
	lastPedestal = targetPedestal;

	getSprite().centerEmitter().start( Speck.factory( Speck.SCREAM ), 0.4f, 2 );		
	Sample.INSTANCE.play( Assets.SND_CHALLENGE );
	
	int undeadsToSummon = maxArmySize() - Undead.count;

	Level level = Dungeon.level;

	for (int i=0; i < undeadsToSummon; i++) {
		int pos = level.getEmptyCellNextTo(lastPedestal);

		if (level.cellValid(pos)) {
			Mob servant = new Undead();
			servant.setPos(pos);
			level.spawnMob(servant, 0);

			WandOfBlink.appear(servant, pos);
			new Flare(3, 32).color(0x000000, false).show(servant.getSprite(), 2f);

			Actor.addDelayed(new Pushing(servant, lastPedestal, servant.getPos()), -1);
		}
	}
	yell(Game.getVar(R.string.King_Info2));
}
 

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

示例7: doSpecial

点赞 3

import com.watabou.pixeldungeon.effects.Flare; //导入依赖的package包/类
@Override
public void doSpecial() {

    SpellSprite.show( getCurUser(), SpellSprite.DOMINATION );
    Sample.INSTANCE.play( Assets.SND_DOMINANCE );

    int mobsDominated = 0;
    for (Mob mob : Dungeon.level.mobs) {
        if (Dungeon.level.fieldOfView[mob.getPos()]) {
            if(mob.canBePet()) {
                Mob.makePet(mob, getCurUser());
                new Flare(3, 32).show(mob.getSprite(), 2f);
            }

            if(mobsDominated > getCurUser().lvl() / 10) {
                break;
            }
        }
    }

    getCurUser().spend( Actor.TICK );
}
 

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

示例8: doRead

点赞 3

import com.watabou.pixeldungeon.effects.Flare; //导入依赖的package包/类
@Override
protected void doRead() {

	new Flare(6, 32).show(getCurUser().getSprite(), 2f);
	Sample.INSTANCE.play(Assets.SND_READ);
	Invisibility.dispel(getCurUser());

	boolean procced = uncurse(getCurUser().belongings);

	Weakness.detach(getCurUser(), Weakness.class);

	if (procced) {
		GLog.p(TXT_PROCCED);
		getCurUser().getSprite().emitter().start(ShadowParticle.UP, 0.05f, 10);
	} else {
		GLog.i(TXT_NOT_PROCCED);
	}

	setKnown();

	getCurUser().spendAndNext(TIME_TO_READ);
}
 

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

示例9: sacrifice

点赞 2

import com.watabou.pixeldungeon.effects.Flare; //导入依赖的package包/类
public static void sacrifice( Char ch ) {
		
		Wound.hit( ch );
		
		SacrificialFire fire = (SacrificialFire)Dungeon.level.blobs.get( SacrificialFire.class );
		if (fire != null) {
			
			int exp = 0;
			if (ch instanceof Mob) {
				exp = ((Mob)ch).exp() * Random.IntRange( 1, 3 );
			} else if (ch instanceof Hero) {
				exp = ((Hero)ch).maxExp();
			}
			
			if (exp > 0) {
				
				int volume = fire.volume - exp;
				if (volume > 0) {
					fire.seed( fire.pos, volume );
					GLog.w( TXT_WORTHY );
				} else {
					fire.seed( fire.pos, 0 );
					Journal.remove( Feature.SACRIFICIAL_FIRE );
					
					GLog.w( TXT_REWARD );
//					GameScene.effect( new Flare( 7, 32 ).color( 0x66FFFF, true ).show( ch.sprite.parent, DungeonTilemap.tileCenterToWorld( fire.pos ), 2f ) );
					GameScene.effect( new Flare( 7, 32 ).color( 0x66FFFF, true ).show( ch.sprite, 2f ) );
					Dungeon.level.drop( new ScrollOfWipeOut(), fire.pos ).sprite.drop();
				}
			} else {
				
				GLog.w( TXT_UNWORTHY );
				
			}
		}
	}
 

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

示例10: Record

点赞 2

import com.watabou.pixeldungeon.effects.Flare; //导入依赖的package包/类
public Record( int pos, boolean latest, Rankings.Record rec ) {
	super();
	
	this.rec = rec;
	
	if (latest) {
		flare = new Flare( 6, 24 );
		flare.angularSpeed = 90;
		flare.color( rec.win ? FLARE_WIN : FLARE_LOSE );
		addToBack( flare );
	}
	
	position.text( Integer.toString( pos+1 ) );
	position.measure();

	Gdx.app.log("DEBUG","rec.info  = "+rec.info );
	desc.text( rec.info );
	desc.measure();
	
	if (rec.win) {
		shield.view( ItemSpriteSheet.AMULET, null );
		position.hardlight( TEXT_WIN );
		desc.hardlight( TEXT_WIN );
	} else {
		position.hardlight( TEXT_LOSE );
		desc.hardlight( TEXT_LOSE );
	}
	
	classIcon.copy( Icons.get( rec.heroClass ) );
}
 

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

示例11: doRead

点赞 2

import com.watabou.pixeldungeon.effects.Flare; //导入依赖的package包/类
@Override
protected void doRead() {
	
	new Flare( 5, 32 ).color( 0xFF0000, true ).show( curUser.sprite, 2f );
	Sample.INSTANCE.play( Assets.SND_READ );
	Invisibility.dispel();
	
	int count = 0;
	Mob affected = null;
	for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) {
		if (Level.fieldOfView[mob.pos]) {
			Buff.affect( mob, Terror.class, Terror.DURATION ).object = curUser.id();
			
			count++;
			affected = mob;
		}
	}
	
	switch (count) {
	case 0:
		GLog.i( "The scroll emits a brilliant flash of red light" );
		break;
	case 1:
		GLog.i( "The scroll emits a brilliant flash of red light and the " + affected.name + " flees!" );
		break;
	default:
		GLog.i( "The scroll emits a brilliant flash of red light and the monsters flee!" );
	}
	setKnown();
	
	readAnimation();
}
 

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

示例12: sacrifice

点赞 2

import com.watabou.pixeldungeon.effects.Flare; //导入依赖的package包/类
public static void sacrifice( Char ch ) {
	
	Wound.hit( ch );
	
	SacrificialFire fire = (SacrificialFire)Dungeon.level.blobs.get( SacrificialFire.class );
	if (fire != null) {
		
		int exp = 0;
		if (ch instanceof Mob) {
			exp = ((Mob)ch).exp() * Random.IntRange( 1, 3 );
		} else if (ch instanceof Hero) {
			exp = ((Hero)ch).maxExp();
		}
		
		if (exp > 0) {
			
			int volume = fire.volume - exp;
			if (volume > 0) {
				fire.seed( fire.pos, volume );
				GLog.w( TXT_WORTHY );
			} else {
				fire.seed( fire.pos, 0 );
				Journal.remove( Feature.SACRIFICIAL_FIRE );
				
				GLog.w( TXT_REWARD );
				GameScene.effect( new Flare( 7, 32 ).color( 0x66FFFF, true ).show( ch.sprite.parent, DungeonTilemap.tileCenterToWorld( fire.pos ), 2f ) );
				Dungeon.level.drop( new ScrollOfWipeOut(), fire.pos ).sprite.drop();
			}
		} else {
			
			GLog.w( TXT_UNWORTHY );
			
		}
	}
}
 

开发者ID:HalcyonFish,
项目名称:OHSCompSciClubPixelDungeon,
代码行数:36,
代码来源:SacrificialFire.java

示例13: Record

点赞 2

import com.watabou.pixeldungeon.effects.Flare; //导入依赖的package包/类
public Record( int pos, boolean latest, Rankings.Record rec ) {
	super();
	
	this.rec = rec;
	
	if (latest) {
		flare = new Flare( 6, 24 );
		flare.angularSpeed = 90;
		flare.color( rec.win ? FLARE_WIN : FLARE_LOSE );
		addToBack( flare );
	}
	
	position.text( Integer.toString( pos+1 ) );
	position.measure();
	
	desc.text( rec.info );
	desc.measure();
	
	if (rec.win) {
		shield.view( ItemSpriteSheet.AMULET, null );
		position.hardlight( TEXT_WIN );
		desc.hardlight( TEXT_WIN );
	} else {
		position.hardlight( TEXT_LOSE );
		desc.hardlight( TEXT_LOSE );
	}
	
	classIcon.copy( Icons.get( rec.heroClass ) );
}
 

开发者ID:HalcyonFish,
项目名称:OHSCompSciClubPixelDungeon,
代码行数:30,
代码来源:RankingsScene.java

示例14: Record

点赞 2

import com.watabou.pixeldungeon.effects.Flare; //导入依赖的package包/类
public Record(int pos, boolean latest, Rankings.Record rec) {
    super();

    this.rec = rec;

    if (latest) {
        flare = new Flare(6, 24);
        flare.angularSpeed = 90;
        flare.color(rec.win ? FLARE_WIN : FLARE_LOSE);
        addToBack(flare);
    }

    position.text(Integer.toString(pos + 1));
    position.measure();

    desc.text(rec.info);
    desc.measure();

    if (rec.win) {
        shield.view(ItemSpriteSheet.AMULET, null);
        position.hardlight(TEXT_WIN);
        desc.hardlight(TEXT_WIN);
    } else {
        position.hardlight(TEXT_LOSE);
        desc.hardlight(TEXT_LOSE);
    }

    classIcon.copy(Icons.get(rec.heroClass));
}
 

开发者ID:skynet67,
项目名称:pixel-dungeon-rebirth,
代码行数:30,
代码来源:RankingsScene.java

示例15: doRead

点赞 2

import com.watabou.pixeldungeon.effects.Flare; //导入依赖的package包/类
@Override
protected void doRead() {
	
	new Flare( 5, 32 ).color( 0xFF0000, true ).show( curUser.sprite, 2f );
	Sample.INSTANCE.play( Assets.SND_READ );
	Invisibility.dispel();
	
	int count = 0;
	Mob affected = null;
	for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) {
		if (Level.fieldOfView[mob.pos]) {
			Buff.affect( mob, Terror.class, Terror.DURATION ).object = curUser.id();
			
			count++;
			affected = mob;
		}
	}
	
	switch (count) {
	case 0:
		GLog.i( "The scroll emits a brilliant flash of red light" );
		break;
	case 1:
		GLog.i( "The scroll emits a brilliant flash of red light and the " + affected.name + " flees!" );
		break;
	default:
		GLog.i( "The scroll emits a brilliant flash of red light and the monsters flee!" );
	}
	setKnown();
	
	curUser.spendAndNext( TIME_TO_READ );
}
 

开发者ID:skynet67,
项目名称:pixel-dungeon-rebirth,
代码行数:33,
代码来源:ScrollOfTerror.java

示例16: die

点赞 2

import com.watabou.pixeldungeon.effects.Flare; //导入依赖的package包/类
@Override
public void die(Object cause) {
	clearActions();

	DewVial.autoDrink(this);
	if (isAlive()) {
		new Flare(8, 32).color(0xFFFF66, true).show(getSprite(), 2f);
		return;
	}

	Actor.fixTime();
	super.die(cause);

	Ankh ankh = belongings.getItem(Ankh.class);

	if (ankh == null) {
		if (this.subClass == HeroSubClass.LICH && this.getSoulPoints() == this.getSoulPointsMax()) {
			this.setSoulPoints(0);
			Dungeon.deleteGame(false);
			GameScene.show(new WndResurrect(null, cause));
		} else {
			reallyDie(cause);
		}
	} else {
		Dungeon.deleteGame(false);
		while (belongings.removeItem(ankh)) {
		}
		GameScene.show(new WndResurrect(ankh, cause));
	}
}
 

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

示例17: canAttack

点赞 2

import com.watabou.pixeldungeon.effects.Flare; //导入依赖的package包/类
@Override
	protected boolean canAttack(Char enemy) {
		if(enemy.buff(RatSkull.RatterAura.class) != null) {
			setState(FLEEING);
			if(buff(Terror.class)==null) {
				new Flare(5, 32).color(0xFF0000, true).show(getSprite(), 2f);
				Terror terror = Buff.affect(this, Terror.class, Terror.DURATION);
				terror.source = enemy;
				return false;
			}
		}
		return super.canAttack(enemy);
}
 

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

示例18: Record

点赞 2

import com.watabou.pixeldungeon.effects.Flare; //导入依赖的package包/类
public Record(int pos, boolean latest, Rankings.Record rec) {
    super();

    this.rec = rec;

    if (latest) {
        flare = new Flare(6, 24);
        flare.angularSpeed = 90;
        flare.color(rec.win ? FLARE_WIN : FLARE_LOSE);
        addToBack(flare);
    }

    position.text(Integer.toString(pos + 1));
    position.measure();

    desc.text(rec.mod + ": " + rec.info);
    desc.measure();

    if (rec.win) {
        shield.view(Assets.ITEMS, ItemSpriteSheet.AMULET, null);
        position.hardlight(TEXT_WIN);
        desc.hardlight(TEXT_WIN);
    } else {
        position.hardlight(TEXT_LOSE);
        desc.hardlight(TEXT_LOSE);
    }

    classIcon.copy(Icons.get(rec.heroClass));
}
 

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

示例19: doRead

点赞 2

import com.watabou.pixeldungeon.effects.Flare; //导入依赖的package包/类
@Override
protected void doRead() {

	SpellSprite.show( getCurUser(), SpellSprite.DOMINATION );
	Sample.INSTANCE.play( Assets.SND_DOMINANCE );
	Invisibility.dispel(getCurUser());
	
	ArrayList<Mob> mobsInSight = new ArrayList<>();
	
	for (Mob mob : Dungeon.level.mobs.toArray(new Mob[Dungeon.level.mobs.size()])) {
		if (Dungeon.level.fieldOfView[mob.getPos()] && !(mob instanceof Boss) && !mob.isPet() && !(mob instanceof NPC)) {
			mobsInSight.add(mob);
		}
	}
	
	while(!mobsInSight.isEmpty()) {
		Mob pet = Random.element(mobsInSight);

		if(pet.canBePet()) {
			Mob.makePet(pet, getCurUser());
			new Flare(3, 32).show(pet.getSprite(), 2f);
			break;
		}
		mobsInSight.remove(pet);
	}
	
	Dungeon.observe();
	
	setKnown();
	
	getCurUser().spendAndNext( TIME_TO_READ );
}
 

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

示例20: doRead

点赞 2

import com.watabou.pixeldungeon.effects.Flare; //导入依赖的package包/类
@Override
protected void doRead() {
	
	new Flare( 5, 32 ).color( 0xFF0000, true ).show( getCurUser().getSprite(), 2f );
	Sample.INSTANCE.play( Assets.SND_READ );
	Invisibility.dispel(getCurUser());
	
	int count = 0;
	Mob affected = null;
	for (Mob mob : Dungeon.level.mobs.toArray(new Mob[Dungeon.level.mobs.size()])) {
		if (Dungeon.level.fieldOfView[mob.getPos()]) {
			Terror terror = Buff.affect( mob, Terror.class, Terror.DURATION );
			terror.source = getCurUser();
			
			count++;
			affected = mob;
		}
	}
	
	switch (count) {
	case 0:
		GLog.i(Game.getVar(R.string.ScrollOfTerror_Info1));
		break;
	case 1:
		GLog.i(Utils.format(Game.getVar(R.string.ScrollOfTerror_Info2), affected.getName()));
		break;
	default:
		GLog.i(Game.getVar(R.string.ScrollOfTerror_Info3));
	}
	setKnown();
	
	getCurUser().spendAndNext( TIME_TO_READ );
}
 

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

示例21: summon

点赞 2

import com.watabou.pixeldungeon.effects.Flare; //导入依赖的package包/类
private void summon() {

		nextPedestal = !nextPedestal;
		
		sprite.centerEmitter().start( Speck.factory( Speck.SCREAM ), 0.4f, 2 );		
		Sample.INSTANCE.play( Assets.SND_CHALLENGE );
		
		boolean[] passable = Level.passable.clone();
		for (Actor actor : Actor.all()) {
			if (actor instanceof Char) {
				passable[((Char)actor).pos] = false;
			}
		}

		int undeadsToSummon = maxArmySize() - Undead.count;
		PathFinder.buildDistanceMap( pos, passable, undeadsToSummon );
		PathFinder.distance[pos] = Integer.MAX_VALUE;
		int dist = 1;
		
	undeadLabel:
		for (int i=0; i < undeadsToSummon; i++) {
			do {
				for (int j=0; j < Level.LENGTH; j++) {
					if (PathFinder.distance[j] == dist) {

						Undead undead = new Undead();
						undead.pos = j;
						GameScene.add( undead );

						WandOfBlink.appear( undead, j );
						new Flare( 3, 32 ).color( 0x000000, false ).show( undead.sprite, 2f ) ;

						PathFinder.distance[j] = Integer.MAX_VALUE;
						
						continue undeadLabel;
					}
				}
				dist++;
			} while (dist < undeadsToSummon);
		}
		
		yell( "Arise, slaves!" );
	}
 

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

示例22: create

点赞 2

import com.watabou.pixeldungeon.effects.Flare; //导入依赖的package包/类
@Override
public void create() {
	super.create();

	BitmapTextMultiline text = createMultiline( TXT, 8 );
	text.maxWidth = Math.min( Camera.main.width, 120 );
	text.measure();
	add( text );

	text.x = align( (Camera.main.width - text.width()) / 2 );
	text.y = align( (Camera.main.height - text.height()) / 2 );

	BitmapTextMultiline link = createMultiline( LNK, 8 );
	link.maxWidth = Math.min( Camera.main.width, 120 );
	link.measure();
	link.hardlight( Window.TITLE_COLOR );
	add( link );

	link.x = text.x;
	link.y = text.y + text.height();

	TouchArea hotArea = new TouchArea( link ) {
		@Override
		protected void onClick( NoosaInputProcessor.Touch touch ) {
			Gdx.net.openURI("http://" + LNK);
		}
	};
	add( hotArea );

	Image wata = Icons.WATA.get();
	wata.x = align( text.x + (text.width() - wata.width) / 2 );
	wata.y = text.y - wata.height - 8;
	add( wata );

	new Flare( 7, 64 ).color( 0x112233, true ).show( wata, 0 ).angularSpeed = +20;

	Archs archs = new Archs();
	archs.setSize( Camera.main.width, Camera.main.height );
	addToBack( archs );

	ExitButton btnExit = new ExitButton();
	btnExit.setPos( Camera.main.width - btnExit.width(), 0 );
	add( btnExit );

	fadeIn();
}
 

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

示例23: create

点赞 2

import com.watabou.pixeldungeon.effects.Flare; //导入依赖的package包/类
@Override
public void create() {
	super.create();
	
	BitmapTextMultiline text = null;
	if (!noText) {
		text = createMultiline( TXT, 8 );
		text.maxWidth = WIDTH;
		text.measure();
		add( text );
	}
	
	amulet = new Image( Assets.AMULET );
	add( amulet );
	
	RedButton btnExit = new RedButton( TXT_EXIT ) {
		@Override
		protected void onClick() {
			Dungeon.win( ResultDescriptions.WIN );
			Dungeon.deleteGame( Dungeon.hero.heroClass, true );
			Game.switchScene( noText ? TitleScene.class : RankingsScene.class );
		}
	};
	btnExit.setSize( WIDTH, BTN_HEIGHT );
	add( btnExit );
	
	RedButton btnStay = new RedButton( TXT_STAY ) {
		@Override
		protected void onClick() {
			onBackPressed();
		}
	};
	btnStay.setSize( WIDTH, BTN_HEIGHT );
	add( btnStay );
	
	float height;
	if (noText) {
		height = amulet.height + LARGE_GAP + btnExit.height() + SMALL_GAP + btnStay.height();
		
		amulet.x = align( (Camera.main.width - amulet.width) / 2 );
		amulet.y = align( (Camera.main.height - height) / 2 );
		
		btnExit.setPos( (Camera.main.width - btnExit.width()) / 2, amulet.y + amulet.height + LARGE_GAP );
		btnStay.setPos( btnExit.left(), btnExit.bottom() + SMALL_GAP );
		
	} else {
		height = amulet.height + LARGE_GAP + text.height() + LARGE_GAP + btnExit.height() + SMALL_GAP + btnStay.height();
		
		amulet.x = align( (Camera.main.width - amulet.width) / 2 );
		amulet.y = align( (Camera.main.height - height) / 2 );
		
		text.x =  align( (Camera.main.width - text.width()) / 2 );
		text.y = amulet.y + amulet.height + LARGE_GAP;
		
		btnExit.setPos( (Camera.main.width - btnExit.width()) / 2, text.y + text.height() + LARGE_GAP );
		btnStay.setPos( btnExit.left(), btnExit.bottom() + SMALL_GAP );
	}

	new Flare( 8, 48 ).color( 0xFFDDBB, true ).show( amulet, 0 ).angularSpeed = +30;
	
	fadeIn();
}
 

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

示例24: create

点赞 2

import com.watabou.pixeldungeon.effects.Flare; //导入依赖的package包/类
@Override
public void create() {
	super.create();
	
	BitmapTextMultiline text = createMultiline( TXT, 8 );
	text.maxWidth = Math.min( Camera.main.width, 120 );
	text.measure();
	add( text );
	
	text.x = align( (Camera.main.width - text.width()) / 2 );
	text.y = align( (Camera.main.height - text.height()) / 2 );
	
	BitmapTextMultiline link = createMultiline( LNK, 8 );
	link.maxWidth = Math.min( Camera.main.width, 120 );
	link.measure();
	link.hardlight( Window.TITLE_COLOR );
	add( link );
	
	link.x = text.x;
	link.y = text.y + text.height();
	
	TouchArea hotArea = new TouchArea( link ) {
		@Override
		protected void onClick( Touch touch ) {
			Intent intent = new Intent( Intent.ACTION_VIEW, Uri.parse( "http://" + LNK ) );
			Game.instance.startActivity( intent );
		}
	};
	add( hotArea );
	
	Image wata = Icons.WATA.get();
	wata.x = align( (Camera.main.width - wata.width) / 2 );
	wata.y = text.y - wata.height - 8;
	add( wata );
	
	new Flare( 7, 64 ).color( 0x112233, true ).show( wata, 0 ).angularSpeed = +20;
	
	Archs archs = new Archs();
	archs.setSize( Camera.main.width, Camera.main.height );
	addToBack( archs );
	
	ExitButton btnExit = new ExitButton();
	btnExit.setPos( Camera.main.width - btnExit.width(), 0 );
	add( btnExit );
	
	fadeIn();
}
 

开发者ID:HalcyonFish,
项目名称:OHSCompSciClubPixelDungeon,
代码行数:48,
代码来源:AboutScene.java

示例25: create

点赞 2

import com.watabou.pixeldungeon.effects.Flare; //导入依赖的package包/类
@Override
    public void create() {
        super.create();

        BitmapTextMultiline text = createMultiline(TXT, 8);
        text.maxWidth = Math.min(Camera.main.width, 120);
        text.measure();
        add(text);

        text.x = align((Camera.main.width - text.width()) / 2);
        text.y = align((Camera.main.height - text.height()) / 2);

        BitmapTextMultiline link = createMultiline(LNK, 8);
        link.maxWidth = Math.min(Camera.main.width, 120);
        link.measure();
        link.hardlight(Window.TITLE_COLOR);
        add(link);

        link.x = text.x;
        link.y = text.y + text.height();

        TouchArea hotArea = new TouchArea(link) {
            @Override
            protected void onClick(NoosaInputProcessor.Touch touch) {
                Gdx.net.openURI("http://" + LNK);

                //TODO run action for platform
//				Intent intent = new Intent( Intent.ACTION_VIEW, Uri.parse( "http://" + LNK ) );
//				Game.instance.startActivity( intent );
            }
        };
        add(hotArea);

        if(Gdx.app.getType() == Application.ApplicationType.iOS) {
            BitmapTextMultiline iosTxt = createMultiline(IOS_PORT_TXT, 8);
            iosTxt.maxWidth = Math.min(Camera.main.width, 120);
            iosTxt.measure();
            add(iosTxt);

            iosTxt.x = link.x;
            iosTxt.y = link.y + link.height();
        }

        Image wata = Icons.WATA.get();
        wata.x = align((Camera.main.width - wata.width) / 2);
        wata.y = text.y - wata.height - 8;
        add(wata);

        new Flare(7, 64).color(0x112233, true).show(wata, 0).angularSpeed = +20;

        Archs archs = new Archs();
        archs.setSize(Camera.main.width, Camera.main.height);
        addToBack(archs);

        ExitButton btnExit = new ExitButton();
        btnExit.setPos(Camera.main.width - btnExit.width(), 0);
        add(btnExit);

        fadeIn();
    }
 

开发者ID:skynet67,
项目名称:pixel-dungeon-rebirth,
代码行数:61,
代码来源:AboutScene.java


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