示例#1
0
void credits (Controller *userInput) {
	
	int i = DISPLAY_HEIGHT;
	playTheme();
	pollController(userInput);
	
	while((!userInput->x) && (i+70 > 0)) {
		lcd_fillScreen(BLACK);
		lcd_putString(DISPLAY_WIDTH/2-20, i, "CREDITS");
		lcd_putString(20, i + 30,    "Shanush and James -- Team Atari");
		lcd_putString(20, i + 50, "           Victor -- Example Project");
		memcpy((char*)LCD_FRAME_BUFFER,(char*)LCD_TEMP_BUFFER, 153600); // write temp buffer to fram buffer
		pollController(userInput);
		i-=2;
	}
	
	stopMusic();
	mdelay(5000);
}
示例#2
0
文件: main.cpp 项目: Iconate/Snipa
int main(int argc, char** argv) {
    glutInit(&argc, argv);
 	glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
 	glutInitWindowSize(win_width, win_height);
 	//glutFullScreen();
 	glutInitWindowPosition(0,0);
 	glutCreateWindow("Snipa");
    gameInit();  //initialize the game, load textures and stuffs
    

	glutSetCursor(GLUT_CURSOR_NONE); // hide mouse
	glutPassiveMotionFunc(mouseMovement); //check for mouse movement
	glutMouseFunc(processMouse); //check for mouse clicks
	
    glutIgnoreKeyRepeat(1);
    glutKeyboardFunc(keyboardDown);
	glutKeyboardUpFunc(keyboardUp);  
	
   
    
    glutDisplayFunc(renderScene); //decide which display handlers to use
    

    glutIdleFunc(renderScene); 
 
     
    glutReshapeFunc(gameReshape);
        
    playTheme();
     
 
    glutTimerFunc (1, bulletAnimation, 0);
   

    glutMainLoop();
}
示例#3
0
int titleScreen (Controller *userInput, int highestScore, int *numberOfLives, char *shipType)  {
	char print = TRUE;
	Position star;
	int seed = 1;
	int i = 0;
	char score[50];
	
	unsigned short *universianArray[SPLASH_FRAMES];
	universianArray[0] = Universian1;
	universianArray[1] = Universian2;
	universianArray[2] = Universian3;
	universianArray[3] = Universian4;
  universianArray[4] = Universian5;
	universianArray[5] = Universian6;
	
	lcd_fillScreen(BLACK);
	
	memcpy((char*)LCD_FRAME_BUFFER,(char*)LCD_TEMP_BUFFER, 153600); // write temp buffer to fram buffer
	
	star.x = 0;
	star.y = 0;
	
	mdelay(300);
	playTheme();
		
	for (i = 0; i < SPLASH_FRAMES; i++) {
		drawBackground(&star);
		lcd_BMP(DISPLAY_WIDTH/2, SPLASH_HEIGHT, -(0.5), -(0.5), universianArray[i], TRUE, FALSE);
		
		memcpy((char*)LCD_FRAME_BUFFER,(char*)LCD_TEMP_BUFFER, 153600); // write temp buffer to fram buffer
		
		mdelay(SPLASH_DELAY);
	}
	
	mdelay(1000);
	
	
	sprintf(score, "Highest Score: %9d", highestScore);
	
	while(!userInput->start) {
		// wait for start button
		drawBackground(&star);
		drawShip(INIT_SHIP_POS_X, INIT_SHIP_POS_Y, DEFAULT_SHIP_TYPE);
		lcd_BMP(DISPLAY_WIDTH/2, SPLASH_HEIGHT, -(0.5), -(0.5), Universian6, TRUE, FALSE);
		if(seed%BLINK_RATE == 0) {
			print = !print;
		}
		if(print) {
			lcd_putString(50, 300, "Press START to continue...");
			//lcd_putString(50, SPLASH_HEIGHT+27, "Press START to continue...");
			//lcd_putString(50, 300, "Press START to continue...");
		}
		lcd_putString(50, SPLASH_HEIGHT+37, (unsigned char *)score);
		lcd_putString(50, SPLASH_HEIGHT+55, "         Made by");
		lcd_putString(50, SPLASH_HEIGHT+65, "    James Slack-smith");
		lcd_putString(50, SPLASH_HEIGHT+75, "Shanush Prema Thasarathan");
		seed++;
		pollController(userInput);
		memcpy((char*)LCD_FRAME_BUFFER,(char*)LCD_TEMP_BUFFER, 153600); // write temp buffer to fram buffer
		/*
		if (userInput->select) {
			selectMenu(userInput, numberOfLives, shipType);
		}
		*/
		mdelay(100);
		pollController(userInput);
		
	}
	stopMusic();
	mdelay(500);
	
	
	return seed;
}