SBSPSS/source/triggers/trestart.cpp

79 lines
1.7 KiB
C++
Raw Normal View History

2001-04-23 22:10:53 +02:00
/*=========================================================================
trestart.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-23 22:10:53 +02:00
#include "triggers\trestart.h"
2001-04-23 23:11:15 +02:00
#ifndef __PLAYER_PLAYER_H__
#include "player\player.h"
#endif
2001-04-23 22:10:53 +02:00
/* Std Lib
------- */
/* Data
---- */
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
/*----------------------------------------------------------------------
Structure defintions
-------------------- */
/*----------------------------------------------------------------------
Function Prototypes
------------------- */
/*----------------------------------------------------------------------
Vars
---- */
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
2001-04-23 23:11:15 +02:00
void CRestartPointTrigger::collidedWith(CThing *_thisThing)
2001-04-23 22:10:53 +02:00
{
2001-04-23 23:11:15 +02:00
CRECT collisionArea;
2001-04-23 22:10:53 +02:00
DVECTOR respawnPos;
2001-06-04 14:54:44 +02:00
switch( _thisThing->getThingType() )
{
case TYPE_PLAYER:
{
collisionArea=getCollisionArea();
respawnPos.vx=collisionArea.x1+((collisionArea.x2-collisionArea.x1)/2);
respawnPos.vy=collisionArea.y2;
2001-06-11 17:27:05 +02:00
((CPlayer*)_thisThing)->setRespawnPosAndRingTelephone(respawnPos);
2001-06-04 14:54:44 +02:00
break;
}
default:
break;
}
2001-04-23 22:10:53 +02:00
}
/*===========================================================================
end */