本文整理汇总了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 );
}
}
示例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 ) );
}
}
}
示例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();
}
}
}
示例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 );
}
示例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;
}
}
示例6: update
import com.watabou.noosa.Game; //导入方法依赖的package包/类
@Override
public void update() {
super.update();
if ((left -= Game.elapsed) <= 0) {
kill();
}
}
示例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 );
}
}
示例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 );
}
}
示例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 );
}
}
示例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);
}
}
}
示例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 );
}
}
示例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;
}
}
示例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();
}
}
示例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);
}
}
示例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;
}
}