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


Java Game类代码示例

本文整理汇总了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();
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:17,代码来源:Archs.java

示例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);
	}
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:20,代码来源:TinkererSprite.java

示例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);
	}
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:20,代码来源:WandmakerSprite.java

示例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();
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:17,代码来源:Window.java

示例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);
	}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:23,代码来源:WndHlpCatTS.java

示例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);
	}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:23,代码来源:WndHlpCatItem.java

示例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 );
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:19,代码来源:WndStory.java

示例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);
		}
	}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:19,代码来源:WndStory.java

示例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);
		}
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:17,代码来源:Badges.java

示例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);
	}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:17,代码来源:Dungeon.java

示例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);
		}
	}
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:25,代码来源:AttackIndicator.java

示例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));
		}
	}
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:19,代码来源:MineLevel.java

示例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;
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:27,代码来源:Chasm.java

示例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 ) );
		}
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:25,代码来源:CavesLevel.java

示例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 );

	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:18,代码来源:Swap.java


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