SBSPSS/source/triggers/tlook.cpp

84 lines
1.8 KiB
C++
Raw Normal View History

2001-04-17 21:25:22 +02:00
/*=========================================================================
tlook.cpp
Author: PKG
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
/*----------------------------------------------------------------------
Includes
-------- */
2001-05-29 22:31:02 +02:00
#include "triggers\trigger.h"
2001-04-17 21:25:22 +02:00
#include "triggers\tlook.h"
2001-04-17 22:09:33 +02:00
#ifndef __PLAYER_PLAYER_H__
#include "player\player.h"
#endif
2001-04-17 21:25:22 +02:00
/* Std Lib
------- */
/* Data
---- */
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
/*----------------------------------------------------------------------
Structure defintions
-------------------- */
/*----------------------------------------------------------------------
Function Prototypes
------------------- */
/*----------------------------------------------------------------------
Vars
---- */
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CLookTrigger::collidedWith(CThing *_thisThing)
{
2001-04-17 22:45:02 +02:00
DVECTOR collCentre;
CRECT collArea;
2001-06-04 14:54:44 +02:00
switch( _thisThing->getThingType() )
2001-04-17 22:45:02 +02:00
{
2001-06-04 14:54:44 +02:00
case TYPE_PLAYER:
{
// Only collide if players feet are inside the trigger
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))
{
((CPlayer*)_thisThing)->setLedgeLookAhead(+4);
}
break;
}
default:
break;
2001-04-17 22:45:02 +02:00
}
2001-04-17 21:25:22 +02:00
}
/*===========================================================================
end */