Java Code Examples for com.watabou.noosa.Game#isPaused()

The following examples show how to use com.watabou.noosa.Game#isPaused() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Hero.java    From remixed-dungeon with GNU General Public License v3.0 5 votes vote down vote up
public static void reallyDie(final Object cause) {

		if (Dungeon.hero.getDifficulty() < 2 && !Game.isPaused()) {
			GameScene.show(new WndSaveSlotSelect(false, Game.getVar(R.string.Hero_AnotherTry)));
			return;
		}

		reallyReallyDie(cause);
	}
 
Example 2
Source File: PixelScene.java    From remixed-dungeon with GNU General Public License v3.0 5 votes vote down vote up
public static void showBadge(Badges.Badge badge) {
	if(!(Game.scene() instanceof GameScene)) {
		return;
	}
	
	if (uiCamera != null && !Game.isPaused()) {
		BadgeBanner banner = BadgeBanner.show(badge.image);
		banner.camera = uiCamera;
		banner.x = align(banner.camera,
				(banner.camera.width - banner.width) / 2);
		banner.y = align(banner.camera,
				(banner.camera.height - banner.height) / 3);
		Game.addToScene(banner);
	}
}
 
Example 3
Source File: GameLog.java    From remixed-dungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onSignal(String text ) {
	if(Game.isPaused()) {
		return;
	}

	int color = CharSprite.DEFAULT;
	if (text.startsWith( GLog.POSITIVE )) {
		text = text.substring( GLog.POSITIVE.length() );
		color = CharSprite.POSITIVE;
	} else if (text.startsWith( GLog.NEGATIVE )) {
		text = text.substring( GLog.NEGATIVE.length() );
		color = CharSprite.NEGATIVE;
	} else if (text.startsWith( GLog.WARNING )) {
		text = text.substring( GLog.WARNING.length() );
		color = CharSprite.WARNING;
	} else if (text.startsWith( GLog.HIGHLIGHT )) {
		text = text.substring( GLog.HIGHLIGHT.length() );
		color = CharSprite.NEUTRAL;
	}

	if(text.isEmpty()) {
		return;
	}

	text = Utils.capitalize( text ) + 
		(PUNCTUATION.matcher( text ).matches() ? Utils.EMPTY_STRING : ".");

	Logbook.addPlayerLogMessage( text, color );	// Store the message to show in log book tab

	if (lastEntry != null && color == lastColor && lastEntry.lines()<3) {
		
		String lastMessage = lastEntry.text();
		lastEntry.text( lastMessage.length() == 0 ? text : lastMessage + " " + text );

	} else {
		lastEntry = PixelScene.createMultiline( text, GuiProperties.regularFontSize());
		lastEntry.maxWidth((int)width);
		lastEntry.hardlight( color );
		lastColor = color;
		add( lastEntry );
		
	}
	
	int texts = 0;
	for (int i = 0; i< getLength(); i++) {
		if(members.get( i ) instanceof Text)
		texts++;
	}
	
	if (texts > MAX_MESSAGES) {
		for(int i = 0; i< getLength(); i++) {
			if(members.get( i ) instanceof Text) {
				Text txt = (Text) members.get( i );
				remove ( txt );
				txt.destroy();
				break;
			}
		}
	}
	
	layout();
}