本文整理汇总了C++中CGameManager::ClearGame方法的典型用法代码示例。如果您正苦于以下问题:C++ CGameManager::ClearGame方法的具体用法?C++ CGameManager::ClearGame怎么用?C++ CGameManager::ClearGame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGameManager
的用法示例。
在下文中一共展示了CGameManager::ClearGame方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
manager.SpeedUp();
}
if(event.key.keysym.sym ==SDLK_p){
gamestatus=2;
}
}else
if(gamestatus==2){
if(event.key.keysym.sym ==SDLK_p){
gamestatus=1;
}
}else
if(gamestatus==3){
if(event.key.keysym.sym == SDLK_RETURN){
if(easy.Active()){manager.SetLevel(1);}else
if(medium.Active()){manager.SetLevel(2);}else
if(hard.Active()){manager.SetLevel(3);}
gamestatus=1;
}else
if(event.key.keysym.sym == SDLK_RIGHT){
if(easy.Active()){easy.ChangeActivity(); medium.ChangeActivity();}else
if(medium.Active()){medium.ChangeActivity(); hard.ChangeActivity();}else
if(hard.Active()){hard.ChangeActivity(); easy.ChangeActivity();}
}else
if(event.key.keysym.sym == SDLK_LEFT){
if(easy.Active()){easy.ChangeActivity(); hard.ChangeActivity();}else
if(medium.Active()){medium.ChangeActivity(); easy.ChangeActivity();}else
if(hard.Active()){hard.ChangeActivity(); medium.ChangeActivity();}
}
}else
if(gamestatus==4){
if(event.key.keysym.sym){
SDL_Delay(1000);
gamestatus=0;
manager.ClearGame();
}
}else
if(gamestatus==5){
if(event.key.keysym.sym){
gamestatus=0;
}
}
break;
}
} // end switch
}// end of message processing
// DRAWING STARTS HERE
// clear screen
SDL_FillRect(screen, 0, SDL_MapRGB(screen->format, 0, 0, 0));
// draw bitmap
if(gamestatus==0){
int a=SDL_GetTicks();
RBC_DrawRect(0, 0, screen->w, screen->h, 0, 0, 50);
RBC_DrawRect((0+frame/2)%screen->w, 0, screen->w/5, screen->h, 105,210,231);
if(((0+frame/2)%screen->w+screen->w/5)>screen->w){RBC_DrawRect(0, 0, ((0+frame/2)%screen->w+screen->w/5)-screen->w, screen->h, 105,210,231);}
RBC_DrawRect((screen->w/5+frame/2)%screen->w, 0, screen->w/5, screen->h, 167,219,216);