Esempio n. 1
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;
		} 
	}
}
Esempio n. 2
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;
		}
	}
}