本文整理汇总了C++中Mover::GetPause方法的典型用法代码示例。如果您正苦于以下问题:C++ Mover::GetPause方法的具体用法?C++ Mover::GetPause怎么用?C++ Mover::GetPause使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mover
的用法示例。
在下文中一共展示了Mover::GetPause方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SaveLevelToDisk
bool LevelFileIO::SaveLevelToDisk(const char * cFilePath, LevelScene * pScene){
if(pScene && pScene->GridOk()){
const int GridWidth = pScene->GetWidth();
const int GridHeight = pScene->GetHeight();
ofstream FileOut(cFilePath);
if(FileOut.is_open()){
FileOut << "Foof72" << endl;
FileOut << GridWidth << endl;
FileOut << GridHeight << endl;
const int Total = GridWidth * GridHeight;
for(int y = 0; y < GridHeight; y++){
//const int YSkip = y * GridWidth;
for(int x = 0; x < GridWidth; x++){
//Output the level grid one tile at a time
const int TileID = pScene->GetGridUnit(x,y);
FileOut << TileID << endl;
}
}
const float PlayerStartX = pScene->GetPlayerStartX();
const float PlayerStartY = pScene->GetPlayerStartY();
//Then player start location
if(PlayerStartX > -1 && PlayerStartY > -1){
FileOut << PlayerStartX << endl;
FileOut << PlayerStartY << endl;
}else{
FileOut << 0 << endl;
FileOut << 0 << endl;
}
//Exit Location
FileOut << pScene->ExitPos_X << endl
<< pScene->ExitPos_Y << endl;
//Output total number of game objects in level
FileOut << pScene->PropList.size() + pScene->EnemyList.size() + pScene->DecoList.size() + pScene->HazardList.size() + pScene->TokenList.size() << endl;
//Output props (coins , etc) if they exist
const int nProps = pScene->PropList.size();
FileOut << nProps << endl;
if(nProps > 0){
for(vector<PropStruct*>::iterator it = pScene->PropList.begin(); it < pScene->PropList.end(); it++){
PropStruct * pProp = (*it);
FileOut << ((int)pProp->uType - 1) << endl
<< pProp->x << endl
<< pProp->y << endl;
}
}
//Output ENEMIES
const int nEnemies = pScene->EnemyList.size();
FileOut << nEnemies << endl;
if(nEnemies > 0){
for(vector<PropStruct*>::iterator it = pScene->EnemyList.begin(); it < pScene->EnemyList.end(); it++){
PropStruct * pProp = (*it);
FileOut << pProp->ExtendedInfo->ArrayID << endl
<< pProp->x << endl
<< pProp->y << endl;
switch(pProp->ExtendedInfo->SubType){
case 2:{
Mover * pMover = (Mover*)pProp;
FileOut << (int)pMover->GetFunctionType() << endl
<< (int)pMover->GetMoverType() << endl
<< pMover->OriginX << endl
<< pMover->OriginY << endl
<< pMover->GetSpeed() << endl
<< pMover->GetWidth() << endl
<< pMover->GetPause() << endl
<< pMover->Sync << endl;
break;
}
case 3:{ //Snapmouth
break;
}
case 5:{ // Destructible
FileOut << (pProp->x - pProp->ExtendedInfo->fDefaultScale) << endl
<< (pProp->x + pProp->ExtendedInfo->fDefaultScale) << endl;
break;
}
case 0:{
//Compute Potential Visibility Bounds
float VisibilityMax, VisibilityMin;
float XDelta = 0.1f;
float X = pProp->x;
float Y = TraceFloorHeight(X, pProp->y) + 0.1f;
float PrevY = Y;
while(abs(Y - PrevY) < 0.15f){
PrevY = Y;
X += XDelta;
Y = TraceFloorHeight(X, Y) + 0.1f;
}
VisibilityMax = X - XDelta*2.0f;
X = pProp->x;
Y = TraceFloorHeight(X, pProp->y) + 0.1f;
PrevY = Y;
while(abs(Y - PrevY) < 0.15f){
PrevY = Y;
//.........这里部分代码省略.........