예제 #1
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    Steuerung w;
    w.show();
    
    return a.exec();
}
예제 #2
0
파일: main.cpp 프로젝트: jjoe64/babydevelop
int main (int argc, char **argv)
{
   QApplication hauptfenster(argc, argv);
   Steuerung steuerung;
   steuerung.show();
   int rueckgabe = hauptfenster.exec();
   return rueckgabe;
}
예제 #3
0
void loop(){
	// Game Loop
	lastFrame = clock();
	while(dist < maxDistance){
		if (!steuerung.process()){ //game stops if there is a problem with the camera
			break;
		}
		float xPos = steuerung.getXPosition();//Schon für die Breite des "Spielfelds" angepasste xPosition erfragen
		int delta = getDelta()*0.1;
		//Auch xPos an view übergeben
		view.draw(delta, xPos); //hier wird alles gezeichnet (inkl Biene)
		dist = dist + delta;
		key = waitKey(30);
		//pause at anykey
		if (key != -1){
			break;
		} 
	}
}
예제 #4
0
void startLoop(){
	// Loop to just move the bee
	lastFrame = clock();
	while (true){
		if (!steuerung.process()){ //stops if there is a problem with the camera
			break;
			gameOn = false;
		}
		//steuerung.process();
		float xPos = steuerung.getXPosition();//Schon für die Breite des "Spielfelds" angepasste xPosition erfragen
		//Auch xPos an view übergeben
		view.drawStart(xPos);
		key = waitKey(30);
		if (key == 27){
			//exit
			gameOn = false;
			break;
		} else if (key != -1) {
			break;
		}
	}
}
예제 #5
0
int main(){
	FreeConsole();
	// waiting for the webcam
	while (!steuerung.initialize()) {
		view.drawCamSearch();
		key = waitKey(0);
		if (key == 27){ // esc
			return 0;
		}
	}

	// let the player see how it works
	startLoop();

	// start the game
	while (gameOn){
		loop();
		if (dist >= maxDistance){
			// end game
			view.drawSolution();
			key = waitKey(0);
			if (key == 27){
				return 0;
			} else if (key != -1){
				//restart game
				dist = 0;
				view = ViewController();
			}
		} else {
			// game paused
			view.drawPause();
			key = waitKey(0);
			if (key == 27){
				return 0;
			}
			// go on
		}
	}
	return 0;
}