本文整理汇总了C++中GameOver函数的典型用法代码示例。如果您正苦于以下问题:C++ GameOver函数的具体用法?C++ GameOver怎么用?C++ GameOver使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GameOver函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetEndTime
void ThreadProc::StatusEndProc ()
{
GetEndTime ();
UIFreshFoo(theTaskList.length ()-1);
GameOver ();
return;
}
示例2: GameOver
void LifeCounter::Die() {
if (lives == 0) {
GameOver();
} else {
lives--;
}
}
示例3: GameOver
void Game::GameOver()
{
sf::Texture BackgroundTexture;
sf::Sprite BackgroundSprite;
BackgroundTexture.loadFromFile("Graphics/MainMenu.jpg");
BackgroundSprite.setTexture(BackgroundTexture);
sf::Text GameOver("Game Over...", Font, 90U);
GameOver.setStyle(sf::Text::Bold);
GameOver.setPosition(300, 320);
sf::Event Event;
while(Window.isOpen())
{
while(Window.pollEvent(Event))
{
if(Event.type == sf::Event::KeyPressed)
{
exit(0);
}
}
Window.clear();
Window.draw(BackgroundSprite);
Window.draw(GameOver);
Window.display();
}
}
示例4: RemoveLine
void CTetrisDlg::OnTimer(UINT_PTR nIDEvent)
{
if(m_pBlock->canMoveDown())
{
m_pBlock->moveDown();
}
else
{
for(CHAR i = ROW - 1; i >= 0; --i)
{
if(CheckLine(i))
{
RemoveLine(i);
++i;
}
}
MSG msg;
while(::PeekMessage(&msg, m_hWnd, 0, 0, PM_REMOVE));
if(IsGameOver(m_gameParam & 0xE0))
{
GameOver();
}
else
{
delete m_pBlock;
m_pBlock = BlockFromIndex(m_gameParam & 0xE0);
NextRandomBlock();
m_nextColor = NextRandomColor();
}
}
Invalidate(FALSE);
CDialog::OnTimer(nIDEvent);
}
示例5: pad_update
void MyPS2Application::Update()
{
// Tell DMAC to send previous graphics data to Graphics Synthesiser (GS)
VIFDynamicDMA.Fire();
// Read the control pad into data buffer
pad_update(PAD_0);
// Check for exit condition
if((pad[0].buttons & PAD_START)&&(pad[0].buttons & PAD_SELECT)) quitting_ = true;
// State Handler
switch (game_state)
{
case INTRO:
Intro();
break;
case MENU:
Menu();
break;
case GAME:
Game();
break;
case GAME_OVER:
GameOver();
break;
}
DSP0.HandleAudio();
DSP1.HandleAudio();
}
示例6: InitGame
// Handle the gameflow, start, restartm die...etc.
void ShipRace::Update()
{
// Get the button to start the game if the game is not already started...Meh !
if (gDInput->keyPressed(DIK_SPACE) && !mGameStarted)
{
// Init the game
InitGame();
}
// If gameOver...
if (!mGameOver)
{
// and the game is started...
if (mGameStarted)
{
// and the ship is dead
if (ship->GetIsDead())
{
// Gameover !
GameOver();
}
}
}
// Else if space is pressed and it is gameover
else if (gDInput->keyPressed(DIK_SPACE) && mGameOver)
{
// Restart the game
RestartGame();
}
}
示例7: switch
bool GameClassic::doRun()
{
SDL_Event event;
if(SDL_PollEvent(&event))
{
switch(event.type)
{
case SDL_QUIT:
{
return false;
break;
}
case SDL_KEYDOWN:
{
if ( event.key.keysym.sym == SDLK_ESCAPE )
{
m_mgr->SetActiveModule(MAINMENU);
return true;
}
if ( event.key.keysym.sym == SDLK_p || event.key.keysym.sym == SDLK_SPACE)
{
doPause();
}
if ( event.key.keysym.sym == SDLK_UP && snake->GetDirection()!=Down)
{
snake->SetDirection(Up);
}
if ( event.key.keysym.sym == SDLK_DOWN && snake->GetDirection()!=Up)
{
snake->SetDirection(Down);
}
if ( event.key.keysym.sym == SDLK_LEFT && snake->GetDirection()!=Right)
{
snake->SetDirection(Left);
}
if ( event.key.keysym.sym == SDLK_RIGHT && snake->GetDirection()!=Left)
{
snake->SetDirection(Right);
}
break;
}
}
}
if(snake->Move())
{
Converter.Convert();
DrawField();
DrawTop();
SDL_Delay(50);
}
else
{
Converter.Convert();
DrawField();
DrawTop();
GameOver();
}
return true;
}
示例8: main
int main(void)
{
int menu;
FsOpenWindow(32, 32, winWidth, winHeight, 1); // 800x600 pixels, useDoubleBuffer=1
int listBase;
listBase=glGenLists(256);
YsGlUseFontBitmap8x12(listBase);
glListBase(listBase);
glDisable(GL_DEPTH_TEST);
glDisable(GL_LIGHTING);
glDepthFunc(GL_ALWAYS);
while(1)
{
menu=Menu();
if(menu==1)
{
int score;
score=Game();
GameOver(score);
}
else if(menu==eStop)
{
break;
}
}
return 0;
}
示例9: GameOver
void Level::Update(float dt)
{
world->Step((dt / 100), 5, 5);
if (player->GetYPos() > lvlHeight)
{
GameOver();
}
}
示例10: siguientePieza
void ControlTetris::siguientePieza(){
posX = 3;
posY = 1;
if(p != NULL) delete p;
p = pSig;
if(!mt->pintaPiezaEn(*p,posY,posX)) throw(GameOver(*mt));
pSig = piezaAleatoria();
mt->pintaPiezaSig(*pSig);
}
示例11: switch
void StepManiaLanServer::ParseData(PacketFunctions& Packet, const unsigned int clientNum)
{
int command = Packet.Read1();
switch (command)
{
case NSCPing:
// No Operation
SendValue(NSServerOffset + NSCPingR, clientNum);
break;
case NSCPingR:
// No Operation response
break;
case NSCHello:
// Hello
Hello(Packet, clientNum);
break;
case NSCGSR:
// Start Request
Client[clientNum]->StartRequest(Packet);
CheckReady(); //This is what ACTUALLY starts the games
break;
case NSCGON:
// GameOver
GameOver(Packet, clientNum);
break;
case NSCGSU:
// StatsUpdate
Client[clientNum]->UpdateStats(Packet);
if (!Client[clientNum]->lowerJudge)
CheckLowerJudge(clientNum);
break;
case NSCSU:
// Style Update
Client[clientNum]->StyleUpdate(Packet);
SendUserList();
break;
case NSCCM:
// Chat message
AnalizeChat(Packet, clientNum);
break;
case NSCRSG:
SelectSong(Packet, clientNum);
break;
case NSCSMS:
ScreenNetMusicSelectStatus(Packet, clientNum);
break;
case NSCUPOpts:
Client[clientNum]->Player[0].options = Packet.ReadNT();
Client[clientNum]->Player[1].options = Packet.ReadNT();
break;
default:
break;
}
}
示例12: drop
void Grid::drop()
{
if(GameOver())
{
return;
}
while(!collision())
{
current->nudge(0,-1);
}
}
示例13: KeyInput
// 블럭 상태 및 스테이지 업뎃
void Tetris::Update()
{
int key = KeyInput();
switch( stage )
{
case INIT :
press_any_key( key );
break;
case READY :
level_select( key );
break;
case RUNNING :
m_block->Move( key );
// 블럭이 바닥이나 다른 블럭에 닿았다면 합침
if( m_block->GetBlockState() == 2 )
merge_block( m_block->GetBlockX(), m_block->GetBlockY() );
// 꽉 찬 라인이 있는지 확인
m_full_line_num = check_full_line();
if( m_full_line_num != 0 )
full_line_Set();
if( stage_data[m_level].clear_line == m_line )
{
++m_level;
if( m_level >= MAX_STAGE )
{
stage = SUCCESS;
}
m_line = 0;
}
// 게임 오버~
if( GameOver() )
stage = FAILED;
break;
case SUCCESS:
case FAILED:
if( key == 'y' || key == 'Y' )
{
stage = READY;
Init();
}
if( key == 'n' || key == 'N' )
stage = RESULT;
break;
case RESULT:
m_bIsGameOver = true;
break;
}
}
示例14: spin
void Grid::spin()
{
if(GameOver())
{
return;
}
if (current)
{
SoundManager::instance()->playSound(spinfx);
current->spin();
}
}
示例15: MoveStep
void GameLayer::update(float dt){
if (!HeadCollideBody(head->getDirec()) && !OutofRange()) {
MoveStep();
if(ifGetFood()){
AddBody();
SetFood();
}
lastbodyposi = body.at(body.size()-1)->getPosition();
}
else{
GameOver();
}
}