This commit is contained in:
parent
87421347b6
commit
5385618c50
10 changed files with 325 additions and 60 deletions
|
@ -17,10 +17,6 @@
|
|||
|
||||
#include "triggers\tlook.h"
|
||||
|
||||
#ifndef __GAME_GAME_H__
|
||||
#include "game\game.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PLAYER_PLAYER_H__
|
||||
#include "player\player.h"
|
||||
#endif
|
||||
|
@ -56,22 +52,20 @@
|
|||
---------------------------------------------------------------------- */
|
||||
void CLookTrigger::collidedWith(CThing *_thisThing)
|
||||
{
|
||||
CPlayer *player;
|
||||
DVECTOR collCentre;
|
||||
CRECT collArea;
|
||||
|
||||
ASSERT(_thisThing->getThingType()==TYPE_PLAYER);
|
||||
|
||||
// Only collide if players feet are inside the trigger
|
||||
player=GameScene.getPlayer();
|
||||
collCentre=player->getCollisionCentre();
|
||||
collCentre=((CPlayer*)_thisThing)->getCollisionCentre();
|
||||
collArea.x1=collCentre.vx-5;
|
||||
collArea.y1=collCentre.vy-5;
|
||||
collArea.x2=collArea.x1+10;
|
||||
collArea.y2=collArea.y1+10;
|
||||
if(checkCollisionAgainstArea(&collArea))
|
||||
{
|
||||
player->setLedgeLookAhead(+4);
|
||||
((CPlayer*)_thisThing)->setLedgeLookAhead(+4);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue