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


Java Game.elapsed方法代码示例

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


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

示例1: update

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

	if (phase < 1) {
		if ((phase -= Game.elapsed) <= 0) {
			killAndErase();
		} else {
			scale.set( (2 - phase) * radius / RADIUS );
			am = phase * (-1);
			aa = phase * (+1);
		}
	}

	if (visible = WandmakerSprite.this.visible) {
		PointF p = WandmakerSprite.this.center();
		point(p.x, p.y );
	}
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:20,代码来源:WandmakerSprite.java

示例2: update

import com.watabou.noosa.Game; //导入方法依赖的package包/类
@Override
public void update() {
	
	if (visible = Dungeon.visible[pos]) {
		
		super.update();
		
		if ((delay -= Game.elapsed) <= 0) {
			
			delay = Random.Float( 5 );
			
			((WindParticle)recycle( WindParticle.class )).reset( 
				x + Random.Float( DungeonTilemap.SIZE ), 
				y + Random.Float( DungeonTilemap.SIZE ) );
		}
	}
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:18,代码来源:WindParticle.java

示例3: update

import com.watabou.noosa.Game; //导入方法依赖的package包/类
@Override
public void update() {
	super.update();
	
	if (duration > 0) {
		if ((lifespan -= Game.elapsed) > 0) {
			
			float p = 1 - lifespan / duration;	// 0 -> 1
			p =  p < 0.25f ? p * 4 : (1 - p) * 1.333f;
			scale.set( p );
			alpha( p );
			
		} else {
			killAndErase();
		}
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:18,代码来源:Flare.java

示例4: update

import com.watabou.noosa.Game; //导入方法依赖的package包/类
@Override
public void update() {
	super.update();
	
	if (phase < 0) {
		if ((phase += Game.elapsed) >= 0) {
			killAndErase();
		} else {
			scale.set( (2 + phase) * radius / RADIUS );
			am = -phase * brightness;
		}
	} else if (phase < 1) {
		if ((phase += Game.elapsed) >= 1) {
			phase = 1;
		}
		scale.set( phase * radius / RADIUS );
		am = phase * brightness;
	}
	
	point( target.x + target.width / 2, target.y + target.height / 2 );
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:22,代码来源:TorchHalo.java

示例5: update

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

	if ((time -= Game.elapsed) <= 0) {
		kill();
	} else {
		float p = time / TIME_TO_FADE;
		alpha(p);
		scale.x = 1 + p;
	}
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:13,代码来源:Wound.java

示例6: update

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

	if ((left -= Game.elapsed) <= 0) {
		kill();
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:9,代码来源:PixelParticle.java

示例7: update

import com.watabou.noosa.Game; //导入方法依赖的package包/类
@Override
public void update() {
	super.update();
	
	if ((time -= Game.elapsed) <= 0) {
		kill();
	} else {
		float p = time / TIME_TO_FADE;
		scale.set( 1 - p );
		alpha( p );
	}
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:13,代码来源:Ripple.java

示例8: update

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

	super.update();

	if (Random.Float() < Game.elapsed) {
		PixelParticle spark = (PixelParticle)sparks.recycle( PixelParticle.Shrinking.class );
		spark.reset( x, y, ColorMath.random( COLOR, 0x66FF66 ), 2, Random.Float( 0.5f, 1.0f ) );
		spark.speed.set(
				Random.Float( -40, +40 ),
				Random.Float( -60, +20 ) );
		spark.acc.set( 0, +80 );
		sparks.add( spark );
	}
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:16,代码来源:Fireball.java

示例9: update

import com.watabou.noosa.Game; //导入方法依赖的package包/类
@Override
public void update() {
	elapsed += Game.elapsed;
	if (elapsed >= interval) {
		updateValues( 1 );
		onComplete();
		kill();
	} else {
		updateValues( elapsed / interval );
	}
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:12,代码来源:Tweener.java

示例10: update

import com.watabou.noosa.Game; //导入方法依赖的package包/类
@Override
public void update() {
	if (visible = Dungeon.visible[pos]) {

		super.update();

		if ((rippleDelay -= Game.elapsed) <= 0) {
			GameScene.ripple(pos + Dungeon.level.getWidth()).y -= DungeonTilemap.SIZE / 2;
			rippleDelay = Random.Float(0.4f, 0.6f);
		}
	}
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:13,代码来源:SewerLevel.java

示例11: update

import com.watabou.noosa.Game; //导入方法依赖的package包/类
@Override
public void update() {
	super.update();
	
	if ((timer -= Game.elapsed) < 0) {
		timer = Random.Float( 0.5f, 5f );
		
		Speck star = (Speck)recycle( Speck.class );
		star.reset( 0, amulet.x + 10.5f, amulet.y + 5.5f, Speck.DISCOVER );
		add( star );
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:13,代码来源:AmuletScene.java

示例12: update

import com.watabou.noosa.Game; //导入方法依赖的package包/类
@Override
public void update() {
	super.update();
	
	x = target.sprite.center().x - SIZE / 2;
	y = target.sprite.y - SIZE;
	
	switch (phase) {
	case FADE_IN:
		alpha( passed / duration );
		scale.set( passed / duration );
		break;
	case STATIC:
		break;
	case FADE_OUT:
		alpha( 1 - passed / duration );
		break;
	}
	
	if ((passed += Game.elapsed) > duration) {
		switch (phase) {
		case FADE_IN:
			phase = Phase.STATIC;
			duration = STATIC_TIME;
			break;
		case STATIC:
			phase = Phase.FADE_OUT;
			duration = FADE_OUT_TIME;
			break;
		case FADE_OUT:
			kill();
			break;
		}
		
		passed = 0;
	}
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:38,代码来源:SpellSprite.java

示例13: update

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

	if (brightness < 1.0f && brightness > MIN_BRIGHTNESS) {
		if ((brightness -= Game.elapsed) <= MIN_BRIGHTNESS) {
			brightness = MIN_BRIGHTNESS;
		}
		updateBrightness();
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:12,代码来源:StartScene.java

示例14: update

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

	super.update();

	if (Random.Float() < Game.elapsed) {
		PixelParticle spark = (PixelParticle) sparks
				.recycle(PixelParticle.Shrinking.class);
		spark.reset(x, y, ColorMath.random(COLOR, 0x66FF66), 2,
				Random.Float(0.5f, 1.0f));
		spark.speed.set(Random.Float(-40, +40), Random.Float(-60, +20));
		spark.acc.set(0, +80);
		sparks.add(spark);
	}
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:16,代码来源:Fireball.java

示例15: update

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

	visible = (heap == null || heap.seen);

	if (dropInterval > 0 && (dropInterval -= Game.elapsed) <= 0) {
		
		speed.set( 0 );
		acc.set( 0 );
		place( heap.pos );

		if (visible) {
			boolean water = Level.water[heap.pos];

			if (water) {
				GameScene.ripple(heap.pos);
			} else {
				int cell = Dungeon.level.map[heap.pos];
				water = (cell == Terrain.WELL || cell == Terrain.ALCHEMY);
			}

			if (!(heap.peek() instanceof Gold)) {
				Sample.INSTANCE.play(water ? Assets.SND_WATER : Assets.SND_STEP, 0.8f, 0.8f, 1.2f);
			}
		}
	}

	if (visible && glowing != null) {
		if (glowUp && (phase += Game.elapsed) > glowing.period) {
			
			glowUp = false;
			phase = glowing.period;
			
		} else if (!glowUp && (phase -= Game.elapsed) < 0) {
			
			glowUp = true;
			phase = 0;
			
		}
		
		float value = phase / glowing.period * 0.6f;
		
		rm = gm = bm = 1 - value;
		ra = glowing.red * value;
		ga = glowing.green * value;
		ba = glowing.blue * value;
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:50,代码来源:ItemSprite.java


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