本文整理汇总了C++中Level::ResetLevel方法的典型用法代码示例。如果您正苦于以下问题:C++ Level::ResetLevel方法的具体用法?C++ Level::ResetLevel怎么用?C++ Level::ResetLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Level
的用法示例。
在下文中一共展示了Level::ResetLevel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
camera.Update(fish.GetPosX(), fish.GetPosY(), fish.GetWidth(), fish.GetHeight());
//Draw background first
level.DrawBackdrop( buffer, camera );
for( int f = 0; f < sceneryFish.size(); f++)
{
sceneryFish[f]->Draw( buffer, camera);
}
for(int s = 0; s < schools.size(); s++)
{
schools[s]->Draw( buffer, camera );
}
level.DrawBackground( buffer, camera );
for(int i = 0; i < nets.size(); i++)
{
nets[i]->Draw( buffer, camera );
}
fish.Draw( buffer, camera );
for(int g = 0; g < gobblerFish.size(); g++)
{
gobblerFish[g]->Draw( buffer, camera );
}
for(int c = 0; c < corals.size(); c++)
{
corals[c]->Draw( buffer, camera );
}
level.DrawForeground( buffer, camera );
hud.Draw( buffer );
if(hud.GetTime() <= 0)
{
state = GAMEOVER;
}
break;
case GAMEOVER:
if(!timer.GetStarted())
{
timer.Start();
}
menu.DrawGameOver( buffer, hud.GetScore(), hud.GetDeaths());
if(timer.GetTicks() >= 5000)
{
state = MENU;
for(int i = 0; i < schools.size(); i++)
{
delete schools[i];
}
schools.clear();
score = 0;
deaths = 0;
hud.Reset();
level.ResetLevel(fish, corals, nets, sceneryFish, gobblerFish);
timer.Stop();
}
break;
case END:
Mix_FreeMusic(music);
delete net;
delete coral;
system.CleanUp(buffer);
return 0;
break;
}
delta.Start();
SDL_Flip( buffer );
SDL_FillRect(buffer, NULL, SDL_MapRGB(buffer->format, 0, 0, 0));
}
if(net != NULL)
{
delete net;
}
if(coral != NULL)
{
delete coral;
}
system.CleanUp(buffer);
return 0;
}