void Creators()
{
	system("cls");
	
	int c = 0;
	
	HANDLE consoleHandle = 0;
	consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);
	SetConsoleTextAttribute(consoleHandle, 11);
	printf("\n%s", CREATORS_TITLE);
	SetConsoleTextAttribute(consoleHandle, 7);
	printf("\n\n1) Borodachov Svyatoslav - Hero movement algorithm");
	printf("\n2) Konnov Ilya - Game menu, english adaptation ");
	printf("\n3) Kotseruba Evgeny - Level design and loading");
	printf("\n4) Nikulin Alexey - Keyboard control, tests and makefile");
	printf("\n5) Ponomarenko Ilya - Rendering levels, documentation and presentation");
	printf("\n\nPress 'Escape' to back on menu ");
		
	do
	{
		c = getch();
	}
	while(c != 27);
	
	if (c == 27)
		GameMenu();
}
Example #2
0
void Game::GameLoop() {
	while(running) {
		switch(game_status) {
		case MENU:
			GameMenu();
			break;
		case EDITOR:
			GameEditor();
			break;
		}
	}
}
Example #3
0
int main( void )
{
    int menuoption;

    // Initialize GLFW
    if( !glfwInit() )
    {
        fprintf( stderr, "Failed to initialize GLFW\n" );
        exit( EXIT_FAILURE );
    }

    // Open OpenGL window
    if( !glfwCreateWindow( WIDTH, HEIGHT, 0,0,0,0, 16,0, GLFW_FULLSCREEN ) )
    {
        fprintf( stderr, "Failed to open GLFW window\n" );
        glfwTerminate();
        exit( EXIT_FAILURE );
    }

    glfwSwapInterval( 1 );

    // Load all textures
    if( !LoadTextures() )
    {
        glfwTerminate();
        exit( EXIT_FAILURE );
    }

    // Main loop
    do
    {
        // Get menu option
        menuoption = GameMenu();

        // If the user wants to play, let him...
        if( menuoption == MENU_PLAY )
        {
            GameLoop();
        }
    }
    while( menuoption != MENU_QUIT );

    // Unload all textures
    if( glfwGetWindowParam( GLFW_OPENED ) )
    {
        glDeleteTextures( NUM_TEXTURES, tex_id );
    }

    // Terminate GLFW
    glfwTerminate();

    exit( EXIT_SUCCESS );
}
Example #4
0
int main( void )
{
    int menuoption;

    // Initialize GLFW
    if( !glfwInit() )
    {
        exit( 0 );
    }

    // Open OpenGL window
    if( !glfwOpenWindow( WIDTH, HEIGHT, 0,0,0,0, 16,0, GLFW_FULLSCREEN ) )
    {
        glfwTerminate();
        exit( 0 );
    }

    // Load all textures
    LoadTextures();

    // Main loop
    do
    {
        // Get menu option
        menuoption = GameMenu();

        // If the user wants to play, let him...
        if( menuoption == MENU_PLAY )
        {
            GameLoop();
        }
    }
    while( menuoption != MENU_QUIT );

    // Unload all textures
    if( glfwGetWindowParam( GLFW_OPENED ) )
    {
        glDeleteTextures( NUM_TEXTURES, tex_id );
    }

    // Terminate GLFW
    glfwTerminate();

    return 0;
}
void Game::GameLoop() {
	while(running) {
		switch(game_status) {
		case MENU:
			GameMenu();
			break;
		case EDITOR:
			GameEditor();
			break;
		
		case GAMEPLAY:
			GamePlay();
			break;
		case MAPCHOOSE:
			MapChoose();
			break;
		}
	}
}
Example #6
0
void
mainmenu (int selectedMenu)
{
	int quit = 0;
	int ret;

	// disable game-specific menu items if a ROM isn't loaded
	if ( ARAM_ROMSIZE == 0 )
    	menuitems[3][0] = '\0';
	else
		sprintf (menuitems[3], "Game Menu");

	VIDEO_WaitVSync ();

	while (quit == 0)
	{
		if(selectedMenu >= 0)
		{
			ret = selectedMenu;
			selectedMenu = -1; // default back to main menu
		}
		else
		{
			ret = RunMenu (menuitems, menucount, (char*)"Main Menu");
		}

		switch (ret)
		{
			case 0:
				// Load ROM Menu
				quit = LoadManager ();
				break;

			case 1:
				// Configure Controllers
				ConfigureControllers ();
				break;

			case 2:
				// Preferences
				PreferencesMenu ();
				break;

			case 3:
				// Game Options
				quit = GameMenu ();
				break;

			case 4:
				// Credits
				Credits ();
				WaitButtonA ();
                break;

			case 5:
				// Reset the Gamecube/Wii
			    Reboot();
                break;

			case 6:
				// Exit to Loader
				#ifdef HW_RVL
					#ifdef WII_DVD
					DI_Close();
					#endif
					exit(0);
				#else	// gamecube
					if (psoid[0] == PSOSDLOADID)
						PSOReload ();
				#endif
				break;

			case -1: // Button B
				// Return to Game
				quit = 1;
				break;
		}
	}

	/*** Remove any still held buttons ***/
	#ifdef HW_RVL
		while( PAD_ButtonsHeld(0) || WPAD_ButtonsHeld(0) )
		    VIDEO_WaitVSync();
	#else
		while( PAD_ButtonsHeld(0) )
		    VIDEO_WaitVSync();
	#endif
}
Example #7
0
void
MainMenu (int selectedMenu)
{
	tb_t start,end;
	mftb(&start);

	int quit = 0;
	int ret;

	#ifdef HW_RVL
	// don't show dvd motor off on the wii
	menuitems[5][0] = 0;
	// rename reset/exit items
	sprintf (menuitems[6], "Return to Wii Menu");
	sprintf (menuitems[7], "Return to Homebrew Channel");
	#endif

	// disable game-specific menu items if a ROM isn't loaded
	if (!ROMLoaded)
    	menuitems[3][0] = '\0';
	else
		sprintf (menuitems[3], "Game Menu");

	VIDEO_WaitVSync ();

	while (quit == 0)
	{
		if(selectedMenu >= 0)
		{
			ret = selectedMenu;
			selectedMenu = -1; // default back to main menu
		}
		else
		{
			ret = RunMenu (menuitems, menucount, (char*)"Main Menu");
		}

		switch (ret)
		{
			case 0:
				// Load ROM Menu
				quit = LoadManager ();
				break;

			case 1:
				// Configure Controllers
				ConfigureControllers ();
				break;

			case 2:
				// Preferences
				PreferencesMenu ();
				break;

			case 3:
				// Game Options
				quit = GameMenu ();
				break;

			case 4:
				// Credits
				Credits ();
				WaitButtonA ();
                break;

			case 5:
				// turn the dvd motor off (GC only)
				#ifdef HW_DOL
				dvd_motor_off ();
				#endif

			case 6:
				// Reset the Gamecube/Wii
			    Reboot();
                break;

			case 7:
				ExitToLoader();
				break;

			case -1: // Button B
				// Return to Game
				if(ROMLoaded)
					quit = 1;
				break;
		}
	}

	// Wait for buttons to be released
	int count = 0; // how long we've been waiting for the user to release the button
	while(count < 50 && (
		PAD_ButtonsHeld(0)
		#ifdef HW_RVL
		|| WPAD_ButtonsHeld(0)
		#endif
	))
	{
		VIDEO_WaitVSync();
		count++;
	}

	mftb(&end);
	loadtimeradjust += tb_diff_msec(&end, &start);
}
void Info()
{
	system("cls");
	
	int c = 0;

	HANDLE consoleHandle = 0;
	consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);
	SetConsoleTextAttribute(consoleHandle, 9);
	printf("\n%s", GAME_MODE);
	SetConsoleTextAttribute(consoleHandle, 7);
	printf("\n\n1) Classic Mode");
	printf("\n2) Escape Mode");
	printf("\n\nPress 'Escape' to back on menu ");
	
	do
	{
		c = getch();
	}
	while ((c != 27) && (c != '1') && (c != '2'));
		
	if (c == 27)
		GameMenu();
	
	switch(c)
	{
		case '1':
		{
			int d = 0;
			
			system("cls");
			HANDLE consoleHandle = 0;
			consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);
			SetConsoleTextAttribute(consoleHandle, 14);
			printf("\n%s", Classic_Mode);
			printf("\nClassic Mode - ");
			SetConsoleTextAttribute(consoleHandle, 7);
			printf("%s", Classic_Mode_is);
			printf("\n\nPress 'Escape' to come back");
			
			do
			{
				d = getch();
			}
			while(d != 27);
			
			if( d == 27)
				Info();
				
			break;
		}
		
		case '2':
		{
			int d = 0;
			
			system("cls");
			HANDLE consoleHandle = 0;
			consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);
			SetConsoleTextAttribute(consoleHandle, 14);
			printf("\n%s", Escape_Mode);
			printf("\nEscape Mode - ");
			SetConsoleTextAttribute(consoleHandle, 7);
			printf("%s", Escape_Mode_is);
			printf("\n\nPress 'Escape' to come back");
			
			do
			{
				d = getch();
			}
			while(d != 27);
			
			if( d == 27)
				Info();
			
			break;
		}
		
		case 27:
		{
			GameMenu();
			break;
		}
	}
}