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


Java Emitter.revive方法代码示例

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


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

示例1: update

import com.watabou.noosa.particles.Emitter; //导入方法依赖的package包/类
@Override
public void update() {
	super.update();

	float health = Dungeon.hero.HP;
	float shield = Dungeon.hero.SHLD;
	float max = Math.max(health + shield, Dungeon.hero.HT);

	if (!Dungeon.hero.isAlive()) {
		avatar.tint(0x000000, 0.5f);
	} else if ((health / max) < 0.3f) {
		warning += Game.elapsed * 5f * (0.4f - (health / max));
		warning %= 1f;
		avatar.tint(ColorMath.interpolate(warning, 0x660000, 0xCC0000, 0x660000), 0.5f);
	} else {
		avatar.resetColor();
	}

	hp.scale.x = health / max;
	this.shield.scale.x = (health + shield) / max;

	exp.scale.x = (width / exp.width) * Dungeon.hero.exp
			/ Dungeon.hero.maxExp();

	if (Dungeon.hero.lvl != lastLvl) {

		if (lastLvl != -1) {
			Emitter emitter = (Emitter) recycle(Emitter.class);
			emitter.revive();
			emitter.pos(27, 27);
			emitter.burst(Speck.factory(Speck.STAR), 12);
		}

		lastLvl = Dungeon.hero.lvl;
		level.text(Integer.toString(lastLvl));
		level.measure();
		level.x = PixelScene.align(27.0f - level.width() / 2);
		level.y = PixelScene.align(27.5f - level.baseLine() / 2);
	}

	int k = IronKey.curDepthQuantity;
	if (k != lastKeys) {
		lastKeys = k;
		keys.text(Integer.toString(lastKeys));
		keys.measure();
		keys.x = width - 8 - keys.width() - 18;
	}

	int tier = Dungeon.hero.tier();
	if (tier != lastTier) {
		lastTier = tier;
		avatar.copy(HeroSprite.avatar(Dungeon.hero.heroClass, tier));
	}
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:55,代码来源:StatusPane.java

示例2: update

import com.watabou.noosa.particles.Emitter; //导入方法依赖的package包/类
@Override
public void update() {
	super.update();

	float health = Dungeon.hero.HP;
	float shield = Dungeon.hero.SHLD;
	float max = Dungeon.hero.HT;

	if (!Dungeon.hero.isAlive()) {
		avatar.tint(0x000000, 0.5f);
	} else if ((health/max) < 0.3f) {
		warning += Game.elapsed * 5f *(0.4f - (health/max));
		warning %= 1f;
		avatar.tint(ColorMath.interpolate(warning, 0x660000, 0xCC0000, 0x660000), 0.5f );
	} else {
		avatar.resetColor();
	}

	hp.scale.x = Math.max( 0, (health-shield)/max);
	shieldedHP.scale.x = health/max;
	rawShielding.scale.x = shield/max;

	exp.scale.x = (width / exp.width) * Dungeon.hero.exp / Dungeon.hero.maxExp();

	if (Dungeon.hero.lvl != lastLvl) {

		if (lastLvl != -1) {
			Emitter emitter = (Emitter)recycle( Emitter.class );
			emitter.revive();
			emitter.pos( 27, 27 );
			emitter.burst( Speck.factory( Speck.STAR ), 12 );
		}

		lastLvl = Dungeon.hero.lvl;
		level.text( Integer.toString( lastLvl ) );
		level.measure();
		level.x = 27.5f - level.width() / 2f;
		level.y = 28.0f - level.baseLine() / 2f;
		PixelScene.align(level);
	}

	int tier = Dungeon.hero.tier();
	if (tier != lastTier) {
		lastTier = tier;
		avatar.copy( HeroSprite.avatar( Dungeon.hero.heroClass, tier ) );
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:48,代码来源:StatusPane.java

示例3: update

import com.watabou.noosa.particles.Emitter; //导入方法依赖的package包/类
@Override
public void update() {
	super.update();
	
	if (tagDanger != danger.visible || tagLoot != loot.visible || tagResume != resume.visible) {
		
		tagDanger = danger.visible;
		tagLoot = loot.visible;
		tagResume = resume.visible;
		
		layoutTags();
	}
	
	float health = (float)Dungeon.hero.HP / Dungeon.hero.HT;
	
	if (health == 0) {
		avatar.tint( 0x000000, 0.6f );
		blood.on = false;
	} else if (health < 0.25f) {
		avatar.tint( 0xcc0000, 0.4f );
		blood.on = true;
	} else {
		avatar.resetColor();
		blood.on = false;
	}
	
	hp.scale.x = health;
	exp.scale.x = (width / exp.width) * Dungeon.hero.exp / Dungeon.hero.maxExp();
	
	if (Dungeon.hero.lvl != lastLvl) {
		
		if (lastLvl != -1) {
			Emitter emitter = (Emitter)recycle( Emitter.class );
			emitter.revive();
			emitter.pos( 27, 27 );
			emitter.burst( Speck.factory( Speck.STAR ), 12 );
		}
		
		lastLvl = Dungeon.hero.lvl;
		level.text( Integer.toString( lastLvl ) );
		level.measure();
		level.x = PixelScene.align( 27.5f - level.width() / 2 );
		level.y = PixelScene.align( 28.0f - level.baseLine() / 2 );
	}
	
	int k = IronKey.curDepthQuantity;
	if (k != lastKeys) {
		lastKeys = k;
		keys.text( Integer.toString( lastKeys ) );
		keys.measure();
		keys.x = width - 8 - keys.width()    - 18;
	}
	
	int tier = Dungeon.hero.tier();
	if (tier != lastTier) {
		lastTier = tier;
		avatar.copy( HeroSprite.avatar( Dungeon.hero.heroClass, tier ) );
	}
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:60,代码来源:StatusPane.java


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