void Menu::draw(Graphics2D& g)
		{
			g.drawWallpaper( Vector2D(0, 0), SCREEN_SIZE );

			// model::Project& proj = getOwner().getProject();
			// model::DataBase& ldb = proj.getLDB();
			// model::SaveData& lsd = proj.getLSD();

			if( cursorNum() == 1 ) drawMainMenu(g);
			else switch( cursor(0) ) {
				case MENU_SKILL:
				case MENU_EQUIP:
					drawMainMenu(g, true);
					break;
				case MENU_QUIT:
					g.drawWindow( Vector2D( (SCREEN_SIZE[0]-quitMessageW_-16)/2, 72 ), Size2D(quitMessageW_+16, 32) );
					g.drawString(quitMessage_, Vector2D( (SCREEN_SIZE[0]-quitMessageW_)/2, 82 ), font::FNT_NORMAL);

					g.drawWindow( Vector2D( (SCREEN_SIZE[0]-yesNoW_-16)/2, 120 ), Size2D(yesNoW_+16, 48) );
					g.drawCursor(
						Vector2D( (SCREEN_SIZE[0]-yesNoW_-8)/2, cursor()*CURSOR_H + 128 ) + cursorMove(),
						Size2D(yesNoW_+8, 16)
					);
					g.drawString(yes_, Vector2D( (SCREEN_SIZE[0]-yesNoW_)/2, 130 ), font::FNT_NORMAL);
					g.drawString(no_ , Vector2D( (SCREEN_SIZE[0]-yesNoW_)/2, 146 ), font::FNT_NORMAL);
					break;
				default: break;
			}
		}
void main()
{

	system("cls");
 

	int keyboard_read=0; // integer to store input from the keyboard
	int PASS=1;          // integer used to signal the application to close
	int currpos=1;       // integer to store the selection from the menu

	drawMainMenu(1); // draw the main menu with selection at option 1

	while (PASS)
	{
		keyboard_read=getch();  // get input from keyboard
		if (keyboard_read == 0) // wait for the input to be given
		{
			keyboard_read = getch();
		}

		switch(keyboard_read) // check the input against these values
		{
			case 72: // if the Up cursor key is pressed
			       if(currpos > 1)
			       {
				  currpos=currpos-1; // move the selection 1 step up
			       }
			       drawMainMenu(currpos); // draw menu with the new selection value
			break;

			case 80: // if the Down cursor key is pressed
				if(currpos >= 1 && currpos < 5)
				{
				  currpos=currpos+1; // move the selection one step down
				}
				drawMainMenu(currpos); // draw menu with new selection value
			break;

			case 13: // if the Return(Enter) key is pressed
				if(currpos==5)  // is the exit command highlighted?
				{
				   PASS=0;      // end the input sequence if yes
				}
			break;


		}


	}


}
Exemple #3
0
void Menu::loopMenu(){
    int quit = 0;
     drawMainMenu();
     while(!quit)
        evn->loopEvents(quit);

}
Exemple #4
0
void eventRFBack( void )
{
    //formRemove();
    //form
    //drawForms();
    taskDelete( "humidity", 0 );
    drawMainMenu();
}
Exemple #5
0
void Menu::runGame(){
    gr = new Game(eng, gra, evn);
    gr->initGame();
    gr->loopGame();
    evn->activateEvent(0);
    evn->activateEvent(1);
    evn->removeEvent(2);
    drawMainMenu();
}
Exemple #6
0
void Menu::drawAboutMenu(){
    drawHeader();
    evn->activateEvent(2);
    gra->drawText(100, 200, "Jest to prosta gra w której trzeba usuwać zbędne klocki", 15);
    gra->drawText(100, 220, "tego samego koloru.\n Za to dostaje się odpowiednio punkty i", 15);
    gra->drawText(100, 240, "bonus czasowy", 15);
    gra->drawText(100, 260, "Autor: Sylwke3100", 15);
    gra->render();
    eng->delay(3000);
    drawMainMenu();
}
Exemple #7
0
//se l'utente si trova in un menu lo disegna e rit. true
//altrim. non fa niente e rit. false
bool MenuMgr::draw() {

	if (!showingGAMEOVER && !showingMainMenu && !showingWin && !showingHelp)
		return false;


	if (showingMainMenu)
		drawMainMenu();
	else if (showingGAMEOVER)
		drawGameOver();
	else if (showingWin)
		drawWin();
	else if (showingHelp) {
		drawHelp();
	}

	return true;
}
Exemple #8
0
void menu::drawMenu()
{
	xOffset = (float) screenwidth/orgWidth;
	yOffset = (float) screenheight/orgHeight;
	
	glClear(GL_COLOR_BUFFER_BIT);

	glEnable( GL_BLEND);
	glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
	
	glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);


	glColor4f(0,0,0,0.4);
	menuBackground.drawSprites(0,0, screenwidth, screenheight);
	glPushMatrix();
		glScalef(xOffset,yOffset,0);

		menuLogo.drawSprites(300,10,700,200);

		if(inMainMenu)
		{
			if (inExitMenu)
				drawExitMenu();
			else
				drawMainMenu();

		}
		else if (inGameMenu)
		{
			if (inExitMenu)
				drawExitMenu();
			else
				drawInGameMenu();	
		}
	glPopMatrix();

}
Exemple #9
0
void runMenu(GameVars* gameVars)
{
#ifdef DEBUG
    debugPrint("MENU\x80");
#endif
    
    //Display menu until user starts game
    drawMainMenu(0x50);
    
    //wait for user to start game with button 1
    readButton();
    
    //Player 1 Button 1 - Play
    if (_BTN_CUR_MASK & _JOY1_B1)
    {
        //Move to Play game state
        moveToNextGameState(gameVars, GEPlayAgain);
    }
    else if (_BTN_CUR_MASK & _JOY1_B2)
    {
        //Show credits screen
        moveToNextGameState(gameVars, GEShowCredits);
    }
}
Exemple #10
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();
		}
    }
}
Exemple #11
0
void updateUI(void){
    if (currentMenuID == 0 || currentMenuID == 1)
		drawSleep();		
		
	else if (currentMenuID == 10){
		cellsPerFrame = 4;
		drawMainMenu();
	}		
	
	else if (currentMenuID == 11){
		cellsPerFrame = 4;
		drawInavlidResearchPeriod();
	}
		
    else if (currentMenuID == 20 || currentMenuID == 44 || currentMenuID == 54){
		cellsPerFrame = 4;
		drawChooseActivity();
	}		
		
	else if (currentMenuID == 21 || currentMenuID == 45 || currentMenuID == 56){
		cellsPerFrame = 4;
		drawChooseMood();
	}		
		
	else if (currentMenuID == 22 || currentMenuID == 46 || currentMenuID == 55 || currentMenuID == 57 || currentMenuID == 61){
		cellsPerFrame = 4;
		if(currentMenuID == 22)
			drawLogConfirm(LOG);
		else if(currentMenuID == 46)
			drawLogConfirm(ADD);
		else if(currentMenuID == 55 || currentMenuID == 57)
			drawLogConfirm(EDIT);
		else if(currentMenuID == 61)
			drawLogConfirm(REMOVE);
	}		
		
    else if (currentMenuID == 30){
		cellsPerFrame = 2;
		drawTimeline();
	}		
		
    else if (currentMenuID == 40){
		cellsPerFrame = 4;
		drawModifyMenu();
	}
    else if (currentMenuID == 41 || currentMenuID == 50 ||  currentMenuID == 60){
		cellsPerFrame = 2;
		if(currentMenuID == 41)
			drawModifyTimeslot(ADD);
		else if(currentMenuID == 50)
			drawModifyTimeslot(EDIT);
		else if(currentMenuID == 60)
			drawModifyTimeslot(REMOVE);
	}		
		
	else if (currentMenuID == 42 || currentMenuID == 52){
		drawChooseStartTime();
		manipulateTime = NEUTRAL;
	}	

	else if (currentMenuID == 43){
		drawNoRecords();
	}	
		
	else if (currentMenuID == 51)
		drawMoodOrActivity();
	
    else if (currentMenuID == 70)
		drawSettings();
		
    else if (currentMenuID == 71){
		drawChangeTime();
		manipulateTime = NEUTRAL;
	}		
		
    else if (currentMenuID == 72)
		drawInvertColourScheme();

    else if (currentMenuID == 73){
		drawResetRecords(0);
	}

    else if (currentMenuID == 74){
	    drawResetRecords(1);
    }		
		
	else if (currentMenuID == 80)
		drawUpload();
		
}	
Exemple #12
0
void showMM2(void){
	drawMainMenu(1);
}
Exemple #13
0
void showMM1(void){
	drawMainMenu(0);
}