本文整理汇总了C++中Transporter::getDestination方法的典型用法代码示例。如果您正苦于以下问题:C++ Transporter::getDestination方法的具体用法?C++ Transporter::getDestination怎么用?C++ Transporter::getDestination使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transporter
的用法示例。
在下文中一共展示了Transporter::getDestination方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: game_loop
//.........这里部分代码省略.........
}
}
//weapon updating
updateWeapon(p1,stick);
collideWeaponMonster(stick, currentMonsters, p1);
updateMonstersX(currentMonsters);
collideMonsterWallX(currentMonsters,currentRoom.collideArray);
updateMonstersY(currentMonsters);
collideMonsterWallY(currentMonsters,currentRoom.collideArray);
//if able to transport
if (p1.leavingTransport == 0)
{
//check for collisions with transporter
currentTrans.exitNumber = currentTrans.playerTransCollision(p1.getX(), p1.getY(),currentArray.array);
if (currentTrans.exitNumber)
{
currentTrans.fromNumber = p1.getCurrentRoom();
p1.leavingTransport = 1;
}
}
//if transporting
if ( p1.leavingTransport == 1)
{
//set room to move to
p1.setCurrentRoom(currentTrans.exitNumber);
currentRoom.getWalkRoom(p1.getCurrentRoom());
//currentRoom.getCollideRoom(p1.getCurrentRoom());
currentArray.getObjects(p1.getCurrentRoom());
getMonsters(currentMonsters, currentArray.array);
//must set player's location to the location of the exit portal in the new room
currentTrans.getDestination(currentArray.array);
p1.setX(currentTrans.destination[0] + tileSize/2);
p1.setY(currentTrans.destination[1] + tileSize/2);
currentTrans.destination[0] = 0;
currentTrans.destination[1] = 0;
p1.leavingTransport = 0;
}
//functions for drawing the player (will need to go elsewhere eventually)
//invincible timer
if (p1.vincible == false)
{
vincibleTimer ++;
tempBlinkTimer --;
p1.blinking = true;
//printf("p1 blinking? %d, %d\n",p1.blinking, tempBlinkTimer);
if (tempBlinkTimer < 0)
{
p1.blinking = false;
if ( tempBlinkTimer == p1.blinkTimer * (-3))
{
tempBlinkTimer = p1.blinkTimer;
}
}
if (vincibleTimer == invincibleTime)
{
p1.vincible = true;
p1.blinking = false;
vincibleTimer = 0;
//printf ("vincible Again \n");
}
}