This commit is contained in:
parent
f12a92d250
commit
5747aa0a7e
1 changed files with 72 additions and 64 deletions
|
@ -522,27 +522,32 @@ DVECTOR const &CamPos=CLevel::getCameraPos();
|
||||||
|
|
||||||
if (player && playerThing)
|
if (player && playerThing)
|
||||||
{
|
{
|
||||||
// Player -> Platform collision
|
int playerIsAlive=!player->isDead();
|
||||||
player->clearPlatform();
|
|
||||||
thing1=s_CollisionLists[CThing::TYPE_PLATFORM];
|
|
||||||
while(thing1)
|
|
||||||
{
|
|
||||||
if(thing1->checkCollisionAgainst(playerThing, _frames))
|
|
||||||
{
|
|
||||||
thing1->collidedWith(playerThing);
|
|
||||||
}
|
|
||||||
thing1=thing1->m_nextCollisionThing;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Player -> Pickup collision
|
// Player -> Platform collision
|
||||||
thing1=s_CollisionLists[CThing::TYPE_PICKUP];
|
if(playerIsAlive)
|
||||||
while(thing1)
|
|
||||||
{
|
{
|
||||||
if(thing1->checkCollisionAgainst(playerThing, _frames))
|
player->clearPlatform();
|
||||||
|
thing1=s_CollisionLists[CThing::TYPE_PLATFORM];
|
||||||
|
while(thing1)
|
||||||
{
|
{
|
||||||
thing1->collidedWith(playerThing);
|
if(thing1->checkCollisionAgainst(playerThing, _frames))
|
||||||
|
{
|
||||||
|
thing1->collidedWith(playerThing);
|
||||||
|
}
|
||||||
|
thing1=thing1->m_nextCollisionThing;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Player -> Pickup collision
|
||||||
|
thing1=s_CollisionLists[CThing::TYPE_PICKUP];
|
||||||
|
while(thing1)
|
||||||
|
{
|
||||||
|
if(thing1->checkCollisionAgainst(playerThing, _frames))
|
||||||
|
{
|
||||||
|
thing1->collidedWith(playerThing);
|
||||||
|
}
|
||||||
|
thing1=thing1->m_nextCollisionThing;
|
||||||
}
|
}
|
||||||
thing1=thing1->m_nextCollisionThing;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Friend -> Pickup collision
|
// Friend -> Pickup collision
|
||||||
|
@ -562,69 +567,72 @@ DVECTOR const &CamPos=CLevel::getCameraPos();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Player -> Enemy collision
|
// Player -> Enemy collision
|
||||||
thing1=s_CollisionLists[CThing::TYPE_ENEMY];
|
if(playerIsAlive)
|
||||||
while(thing1)
|
|
||||||
{
|
{
|
||||||
if(thing1->checkCollisionAgainst(playerThing, _frames))
|
thing1=s_CollisionLists[CThing::TYPE_ENEMY];
|
||||||
|
while(thing1)
|
||||||
{
|
{
|
||||||
thing1->collidedWith(playerThing);
|
if(thing1->checkCollisionAgainst(playerThing, _frames))
|
||||||
|
{
|
||||||
|
thing1->collidedWith(playerThing);
|
||||||
|
}
|
||||||
|
thing1=thing1->m_nextCollisionThing;
|
||||||
}
|
}
|
||||||
thing1=thing1->m_nextCollisionThing;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Player -> Effect collision
|
// Player -> Effect collision
|
||||||
thing1=s_CollisionLists[CThing::TYPE_FX];
|
thing1=s_CollisionLists[CThing::TYPE_FX];
|
||||||
while(thing1)
|
while(thing1)
|
||||||
{
|
|
||||||
if(thing1->checkCollisionAgainst(playerThing, _frames))
|
|
||||||
{
|
{
|
||||||
thing1->collidedWith(playerThing);
|
if(thing1->checkCollisionAgainst(playerThing, _frames))
|
||||||
|
{
|
||||||
|
thing1->collidedWith(playerThing);
|
||||||
|
}
|
||||||
|
thing1=thing1->m_nextCollisionThing;
|
||||||
}
|
}
|
||||||
thing1=thing1->m_nextCollisionThing;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Player -> Friend collision
|
// Player -> Friend collision
|
||||||
thing1=s_CollisionLists[CThing::TYPE_NPC];
|
thing1=s_CollisionLists[CThing::TYPE_NPC];
|
||||||
while(thing1)
|
while(thing1)
|
||||||
{
|
|
||||||
if(thing1->checkCollisionAgainst(playerThing, _frames))
|
|
||||||
{
|
{
|
||||||
thing1->collidedWith(playerThing);
|
if(thing1->checkCollisionAgainst(playerThing, _frames))
|
||||||
|
{
|
||||||
|
thing1->collidedWith(playerThing);
|
||||||
|
}
|
||||||
|
thing1=thing1->m_nextCollisionThing;
|
||||||
}
|
}
|
||||||
thing1=thing1->m_nextCollisionThing;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Player -> Hazard collision
|
// Player -> Hazard collision
|
||||||
thing1=s_CollisionLists[CThing::TYPE_HAZARD];
|
thing1=s_CollisionLists[CThing::TYPE_HAZARD];
|
||||||
while(thing1)
|
while(thing1)
|
||||||
{
|
|
||||||
if(thing1->checkCollisionAgainst(playerThing, _frames))
|
|
||||||
{
|
{
|
||||||
thing1->collidedWith(playerThing);
|
|
||||||
}
|
|
||||||
thing1=thing1->m_nextCollisionThing;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Player -> Enemy projectile collision
|
|
||||||
thing1=s_CollisionLists[CThing::TYPE_ENEMYPROJECTILE];
|
|
||||||
while(thing1)
|
|
||||||
{
|
|
||||||
if(thing1->checkCollisionAgainst(playerThing, _frames))
|
if(thing1->checkCollisionAgainst(playerThing, _frames))
|
||||||
{
|
{
|
||||||
thing1->collidedWith(playerThing);
|
thing1->collidedWith(playerThing);
|
||||||
|
}
|
||||||
|
thing1=thing1->m_nextCollisionThing;
|
||||||
}
|
}
|
||||||
thing1=thing1->m_nextCollisionThing;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Player -> Trigger collision
|
// Player -> Enemy projectile collision
|
||||||
thing1=s_CollisionLists[CThing::TYPE_TRIGGER];
|
thing1=s_CollisionLists[CThing::TYPE_ENEMYPROJECTILE];
|
||||||
while(thing1)
|
while(thing1)
|
||||||
{
|
|
||||||
if(thing1->checkCollisionAgainst(playerThing, _frames))
|
|
||||||
{
|
{
|
||||||
thing1->collidedWith(playerThing);
|
if(thing1->checkCollisionAgainst(playerThing, _frames))
|
||||||
|
{
|
||||||
|
thing1->collidedWith(playerThing);
|
||||||
|
}
|
||||||
|
thing1=thing1->m_nextCollisionThing;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Player -> Trigger collision
|
||||||
|
thing1=s_CollisionLists[CThing::TYPE_TRIGGER];
|
||||||
|
while(thing1)
|
||||||
|
{
|
||||||
|
if(thing1->checkCollisionAgainst(playerThing, _frames))
|
||||||
|
{
|
||||||
|
thing1->collidedWith(playerThing);
|
||||||
|
}
|
||||||
|
thing1=thing1->m_nextCollisionThing;
|
||||||
}
|
}
|
||||||
thing1=thing1->m_nextCollisionThing;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Friend -> Trigger collision
|
// Friend -> Trigger collision
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue