本文整理汇总了C++中Transporter::playerTransCollision方法的典型用法代码示例。如果您正苦于以下问题:C++ Transporter::playerTransCollision方法的具体用法?C++ Transporter::playerTransCollision怎么用?C++ Transporter::playerTransCollision使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transporter
的用法示例。
在下文中一共展示了Transporter::playerTransCollision方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: game_loop
//.........这里部分代码省略.........
collidePlayerWallY(p1,currentRoom.collideArray);
p1.setDy(p1.getDy() * p1.getFriction());
//Monster movement and wall collisions
for (int i = 0; i < numMonsters; i++)
{
if (currentMonsters[i].isLive)
{
newPathfindMonster( currentMonsters[i], p1, currentRoom.collideArray);
}
}
//seekMonsters(currentMonsters[1],p1.getX(), p1.getY());
for (int i = 0; i < numMonsters; i++)
{
if (currentMonsters[i].isLive)
{
//seekPathMonsters(currentMonsters[i],p1);
seekMonsters(currentMonsters[i],currentMonsters[i].destX, currentMonsters[i].destY);
}
}
//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 --;