Esempio n. 1
0
////
// Process Routines
////
void CMenuVorticon::processSpecific()
{
	// Information Mode?
	if(!mp_InfoScene) // show a normal menu
	{
		// Process the Menu Type logic.
		CMenu::process();
		processMainMenu();
	}
	else // InfoScene is enabled! show it instead of the menu
	{
		mp_InfoScene->process();
		
		if(mp_InfoScene->destroyed())
		{
			SAFE_DELETE(mp_InfoScene); // Destroy the InfoScene and go back to the menu!!!
									   // Restore the old map, that was hidden behind the scene
			g_pInput->flushAll();
			g_pVideoDriver->setScrollBuffer(&m_Map.m_scrollx_buf, &m_Map.m_scrolly_buf);
			m_Map.drawAll();
			m_Map.m_animation_enabled = true;
			m_hideobjects = false;
		}
	}
}
Esempio n. 2
0
void MainMenu::ProcessEvent(Rocket::Core::Event& event)
{
    const Rocket::Core::String& id = event.GetCurrentElement()->GetId();

    //process submenus first since those are on top, obviously..
    if (m_mainMenuSingleplayerCreate->IsVisible()) {
        processSingleplayerCreate(event);
        return;
    } else if (m_mainMenuSingleplayerLoad->IsVisible()) {
        processSingleplayerLoad(event);
        return;
    }

    if (m_mainMenuSingleplayer->IsVisible()) {
        processSingleplayer(event);
        return;
    }

    if (m_mainMenuMultiplayerHost->IsVisible()) {
        processMultiplayerHost(event);
        return;
    }

    if (m_mainMenuMultiplayerJoin->IsVisible()) {
        processMultiplayerJoin(event);
        return;
    }

    // process parent/non-submenus
    if (m_mainMenuMultiplayer->IsVisible()) {
        processMultiplayer(event);
        return;
    }

    if (m_escapeMenu->IsVisible()) {
        //user pressed escape, aka is in game with a connection (either SP or MP)
        processEscapeMenu(event);
        return;
    }

    if (m_menu->IsVisible()) {
        processMainMenu(event);
        return;
    }
}
Esempio n. 3
0
/**
 * \brief The main game loop. This just cycles endlessly, it uses the game's 'state' to determine which screen to show and what to do.
 */
int main(){
	//looping back and forth forever (cards against humanity reference)
	while(1)
	{
		//some basic prep work performed once before our custom intro
		if(game_state == INTRO)
		{
			initialSetup();
			initIntro();
		}
		//perform custom intro
		while(game_state == INTRO)
		{
			//wait until the next frame
			WaitVsync(1);
			drawIntro();
			processIntro();
		}
		//prep the main menu
		if(game_state == MAIN_MENU)
		{
			FadeOut(0,true);
			ClearVram();
			SetTileTable(title_tiles);
			SetFontTilesIndex(TITLE_TILES_SIZE);
			drawMainMenu();
			FadeIn(0,false);
		}
		//draw menu and handle input
		while(game_state == MAIN_MENU)
		{
			WaitVsync(1);
			drawMenuCursor();
			processMainMenu();
		}
		if(game_state== GAME)
		{
			//run our setup for the main game
			ClearVram();
			FadeOut(0,true);
			gameSetup();
			FadeIn(0,false);
		}
		//when we're in the gameplay portion, draw and accept input for the game
		while(game_state == GAME)
		{
			WaitVsync(1);
			processScrollSpeed(); //scrolls screen as appropriate
			updateCity(); //offsets city for parallax
			processControls(); //accepts and processes controller input
			processPlayerMotion(); //update player position
			processSprites(); //updates and moves player image to player position
		}
		if(game_state == HIGH_SCORES)
		{
			FadeOut(0,true);
			SetTileTable(title_tiles);
			SetFontTilesIndex(TITLE_TILES_SIZE);
			drawLocalHighScoreMenu(); //draw up the high score screen
			FadeIn(0,false);
			deathclock=120; //reset death timer to 2 seconds
			if(score > topscores[9])
			{
			    LoadScore(0, 9); //load top 10 saved high scores
			    SaveScore(score); //save our current score if it's high enough
			    drawLocalHighScoreMenu(); //draw up the high score screen
			}
		}
		//draw and accepts input for the local high score screen
		while(game_state == HIGH_SCORES)
		{
			WaitVsync(1);
			processHighScoreMenu();
		}
    }
}