本文整理汇总了C++中CGameManager::MoveBlockDown方法的典型用法代码示例。如果您正苦于以下问题:C++ CGameManager::MoveBlockDown方法的具体用法?C++ CGameManager::MoveBlockDown怎么用?C++ CGameManager::MoveBlockDown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGameManager
的用法示例。
在下文中一共展示了CGameManager::MoveBlockDown方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
{
// exit if the window is closed
case SDL_QUIT:
done = true;
break;
// check for keypresses
case SDL_KEYDOWN:
{
// exit if ESCAPE is pressed
if (event.key.keysym.sym == SDLK_ESCAPE)
{done = true;}
if(!gamestatus)
{
if(event.key.keysym.sym == SDLK_DOWN){
if(start.Active()){start.ChangeActivity(); help.ChangeActivity();}else
if(help.Active()){help.ChangeActivity(); exit.ChangeActivity();}else
if(exit.Active()){exit.ChangeActivity(); start.ChangeActivity();}
}
else if(event.key.keysym.sym == SDLK_UP){
if(start.Active()){start.ChangeActivity(); exit.ChangeActivity();}else
if(help.Active()){help.ChangeActivity(); start.ChangeActivity();}else
if(exit.Active()){exit.ChangeActivity(); help.ChangeActivity();}
}
if(event.key.keysym.sym == SDLK_RETURN){
if(start.Active()){gamestatus=3;}
else if(help.Active()){gamestatus=5;}
else if(exit.Active()){done=1;}
}
}else
if(gamestatus==1){
if(event.key.keysym.sym == SDLK_DOWN){
manager.MoveBlockDown(&GameBlock, 1);
}
if(event.key.keysym.sym == SDLK_SPACE){
manager.TurnGameBlock(&GameBlock);
}
if(event.key.keysym.sym == SDLK_LEFT){
manager.MoveBlockLeft(&GameBlock);
}
if(event.key.keysym.sym == SDLK_RIGHT){
manager.MoveBlockRight(&GameBlock);
}
if(event.key.keysym.sym == SDLK_w){
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