예제 #1
0
void MY_Scene_Base::update(Step * _step){


	controller->update(_step);

	// basic debugging controls
	if(keyboard->keyJustDown(GLFW_KEY_ESCAPE)){
		game->exit();
	}if(keyboard->keyJustDown(GLFW_KEY_F11)){
		game->toggleFullScreen();
	}if(keyboard->keyJustDown(GLFW_KEY_1)){
		cycleCamera();
	}if(keyboard->keyJustDown(GLFW_KEY_2)){
		toggleDebug();
	}

	glm::uvec2 sd = sweet::getWindowDimensions();
	uiLayer->resize(0, sd.x, 0, sd.y);
	Scene::update(_step);
	uiLayer->update(_step);
}
예제 #2
0
void TTFB_MenuScene::update(Step* _step) {

	if(!musicPlaying) {
		music->play(true);
		musicPlaying = true;
	}

	bulletWorld->update(_step);

	glm::uvec2 sd = sweet::getScreenDimensions();
	uiLayer.resize(0, sd.x, 0, sd.y);

	uiLayer.update(_step);

	if(keyboard->keyJustDown(GLFW_KEY_F12)){
		game->toggleFullScreen();
	}

	if(keyboard->keyJustDown(GLFW_KEY_1)){
		cycleCamera();
	}

	debugCam->update(_step);

	camController->update(_step);

	if((controller->IsConnected() && controller->specialFireButton.justDown()) || keyboard->keyJustUp(GLFW_KEY_P)) {
		if(introScreen->isVisible()){
			controller->clearBindings();
			((TTFB_Game *)game)->switchToScene(SPAMALOT);
			return;
		}else {
			introScreen->setVisible(true);
			introSpeech->play();
		}
	}
	Scene::update(_step);
}