本文整理汇总了Java中com.watabou.noosa.Game类的典型用法代码示例。如果您正苦于以下问题:Java Game类的具体用法?Java Game怎么用?Java Game使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Game类属于com.watabou.noosa包,在下文中一共展示了Game类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: update
import com.watabou.noosa.Game; //导入依赖的package包/类
@Override
public void update() {
super.update();
float shift = Game.elapsed * SCROLL_SPEED;
if (reversed) {
shift = -shift;
}
arcsBg.offset( 0, shift );
arcsFg.offset( 0, shift * 2 );
offsB = arcsBg.offsetY();
offsF = arcsFg.offsetY();
}
示例2: 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 = TinkererSprite.this.visible) {
PointF p = TinkererSprite.this.center();
point(p.x, p.y);
}
}
示例3: 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);
}
}
示例4: onSignal
import com.watabou.noosa.Game; //导入依赖的package包/类
@Override
public void onSignal( NoosaInputProcessor.Key<GameAction> key ) {
if (key.pressed) {
switch (key.code) {
case Input.Keys.BACK:
onBackPressed();
break;
case Input.Keys.MENU:
onMenuPressed();
break;
}
}
Game.instance.getInputProcessor().cancelKeyEvent();
}
示例5: WndHlpCatTS
import com.watabou.noosa.Game; //导入依赖的package包/类
public WndHlpCatTS() {
super();
addButton(new NewRedButton(Messages.get(WndHlpCatMec.class, "3")) {
@Override
protected void onClick() {
hide();
Game.scene().add(new WndHelp(new BugSolve()));
}
});
addButton(new NewRedButton(Messages.get(WndHlpCatMec.class, "4")) {
@Override
protected void onClick() {
hide();
Game.scene().add(new WndRecoverSave());
}
});
resize(WIDTH, pos);
}
示例6: WndHlpCatItem
import com.watabou.noosa.Game; //导入依赖的package包/类
public WndHlpCatItem() {
super();
addButton(new NewRedButton(Messages.get(WndHlpCatItem.class, "intro")) {
@Override
protected void onClick() {
hide();
Game.scene().add(new WndHelp(new ItemIntro()));
}
});
addButton(new NewRedButton(Messages.get(WndHlpCatItem.class, "misc")) {
@Override
protected void onClick() {
hide();
Game.scene().add(new WndHlpCatItemMisc());
}
});
resize(WIDTH, pos);
}
示例7: showChapter
import com.watabou.noosa.Game; //导入依赖的package包/类
public static void showChapter( int id ) {
if (Dungeon.chapters.contains( id )) {
return;
}
String text = Messages.get(WndStory.class, CHAPTERS.get( id ));
if (text != null) {
WndStory wnd = new WndStory( text );
if ((wnd.delay = 0.6f) > 0) {
wnd.shadow.visible = wnd.chrome.visible = wnd.tf.visible = false;
}
Game.scene().add( wnd );
Dungeon.chapters.add( id );
}
}
示例8: showChapter
import com.watabou.noosa.Game; //导入依赖的package包/类
public static void showChapter(int id) {
if (Dungeon.chapters.contains(id)) {
return;
}
String text = CHAPTERS.get(id);
if (text != null) {
WndStory wnd = new WndStory(text);
if ((wnd.delay = 0.6f) > 0) {
wnd.shadow.visible = wnd.chrome.visible = wnd.tf.visible = false;
}
Game.scene().add(wnd);
Dungeon.chapters.add(id);
}
}
示例9: saveGlobal
import com.watabou.noosa.Game; //导入依赖的package包/类
public static void saveGlobal() {
if (saveNeeded) {
Bundle bundle = new Bundle();
store( bundle, global );
try {
OutputStream output = Game.instance.openFileOutput( BADGES_FILE, Game.MODE_PRIVATE );
Bundle.write( bundle, output );
output.close();
saveNeeded = false;
} catch (IOException e) {
UNISTPixelDungeon.reportException(e);
}
}
}
示例10: deleteGame
import com.watabou.noosa.Game; //导入依赖的package包/类
public static void deleteGame(HeroClass cl, boolean deleteLevels) {
Game.instance.deleteFile(gameFile(cl));
if (deleteLevels) {
int depth = 1;
while (Game.instance.deleteFile(Utils.format(depthFile(cl), depth))) {
depth++;
}
for (int i = 1; i < 200; i++) {
Game.instance.deleteFile(Utils.format(depthFile(cl), i));
}
}
GamesInProgress.delete(cl);
}
示例11: update
import com.watabou.noosa.Game; //导入依赖的package包/类
@Override
public synchronized void update() {
super.update();
if (!bg.visible) {
enable(false);
if (delay > 0f)
delay -= Game.elapsed;
if (delay <= 0f)
active = false;
} else {
delay = 0.75f;
active = true;
if (Dungeon.hero.isAlive()) {
enable(Dungeon.hero.ready);
} else {
visible(false);
enable(false);
}
}
}
示例12: 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();
PointF p = DungeonTilemap.tileToWorld(pos);
((Sparkle) recycle(Sparkle.class)).reset(
p.x + Random.Float(DungeonTilemap.SIZE), p.y
+ Random.Float(DungeonTilemap.SIZE));
}
}
}
示例13: heroFall
import com.watabou.noosa.Game; //导入依赖的package包/类
public static void heroFall( int pos ) {
jumpConfirmed = false;
Sample.INSTANCE.play( Assets.SND_FALLING );
Buff buff = Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class);
if (buff != null) buff.detach();
for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] ))
if (mob instanceof DriedRose.GhostHero) mob.destroy();
if (Dungeon.hero.isAlive()) {
Dungeon.hero.interrupt();
InterlevelScene.mode = InterlevelScene.Mode.FALL;
if (Dungeon.level instanceof RegularLevel) {
Room room = ((RegularLevel)Dungeon.level).room( pos );
InterlevelScene.fallIntoPit = room != null && room.type == Room.Type.WEAK_FLOOR;
} else {
InterlevelScene.fallIntoPit = false;
}
Game.switchScene( InterlevelScene.class );
} else {
Dungeon.hero.sprite.visible = false;
}
}
示例14: update
import com.watabou.noosa.Game; //导入依赖的package包/类
@Override
public void update() {
if (visible = Dungeon.visible[pos]) {
super.update();
if ((delay -= Game.elapsed) <= 0) {
//pickaxe can remove the ore, should remove the sparkling too.
if (Dungeon.level.map[pos] != Terrain.WALL_DECO){
kill();
return;
}
delay = Random.Float();
PointF p = DungeonTilemap.tileToWorld( pos );
((Sparkle)recycle( Sparkle.class )).reset(
p.x + Random.Float( DungeonTilemap.SIZE ),
p.y + Random.Float( DungeonTilemap.SIZE ) );
}
}
}
示例15: update
import com.watabou.noosa.Game; //导入依赖的package包/类
@Override
public void update() {
super.update();
if ((passed += Game.elapsed) < delay) {
sprite.x = x;
sprite.y = y;
} else {
sprite.point( end );
killAndErase();
finish( this );
}
}