コード例 #1
0
ファイル: World.cpp プロジェクト: zhangang15/Game_Engineering
//Think method
void 
World::Think(float time)
{
	if(mGameOver){
		if(!mShowFinalUI){
			mShowFinalUI = true;
			showFinalUI();
		} else{
			handleFinalUI();
		}
	} else {

		if(mInputHandler->IsKeyDown(OIS::KC_ESCAPE) && !mShowUI && !mShowInitialUI){
			UICount = UICount + 1;
			if(UICount > 10){
				showUI();
				mShowUI = true;
				UICount = 0;
			}
		
		} else if(mInputHandler->IsKeyDown(OIS::KC_ESCAPE) && mShowUI && !mShowInitialUI){
		
			UICount = UICount + 1;
			if(UICount > 10){
				hideUI();
				mShowUI = false;
				UICount = 0;
			}
		}
		if(mShowUI || mShowInitialUI){
			//Handle UI
			handleUI();
			hideSpeed();
		} else {
			PhysicsWorld::getInstance()->simulate(time);
			//Control Player
			controlPlayer(time);
			updateLaps();
			showSpeed();
		
		}
	}
	
	
	
}
コード例 #2
0
/*
The Play method : makes use of the Load,update,settings and the playlist class

*/
void PlayerFMOD::play()
{
load();

    /*
        Main loop.
    */
    do
    {
        
         checkNplayNext();
          controlPlayer();
           updatePlayer();

        Sleep(10);

    } while (key != 27);
     
    printf("\n");


}