Ejemplo n.º 1
0
void main() {
	cout << "ok";

	//--------------------- LOAD ARDUINO'S COMMUNICATION

	if (SP->IsConnected())
		printf("We're connected");

	//char incomingData[256] = "";	// don't forget to pre-allocate memory



	//------------------LOAD RANDOM
	srand(time(NULL)); // Create a seed to start the random from
	
	//------------------ LOAD PLAYER' SAVE
	//lvl.LoadGame("player1.txt");

	//Gestion de la fenetre
	//glutInitWindowPosition(10, 10);
	//glutInitWindowSize(1000, 1000);
	glutInitDisplayMode(GLUT_RGBA | GLUT_SINGLE);		//A remplacer pour l'affichage sur d'autres PC par GLUT_DOUBLE
	//glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);
	glutCreateWindow("TerraSkweek");
	glutFullScreen();           // making the window full screen


	//----------------------- LOAD EVERYBODY'S SPRITES
	menu.LoadAllTextures();
	lvl.LoadAllTextures();
	player.LoadAllTextures();
	hud.LoadAllTextures();
		
	//Gestion des evenements
	glutDisplayFunc(Display);
	glutReshapeFunc(Redim);
	glutSpecialFunc(KeyAction); // Switch player's direction

	glutKeyboardFunc(KeyButtons);// Keyboard keys to control the HUD // and Fire
	//glutTimerFunc(700, EnemiesTimer, 0); // Direction for the enemiesd
	glutTimerFunc(refreshRate, PlayerMovt, 0); // Continuous movement of the player
	glutTimerFunc(enemySpawnFrequency, ActivateSpawnMob, 0);
	//glutIdleFunc(Idle);

	glutMainLoop();
}