SBSPSS/source/triggers/trestart.cpp
2001-05-29 20:31:02 +00:00

70 lines
1.6 KiB
C++

/*=========================================================================
trestart.cpp
Author: PKG
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
/*----------------------------------------------------------------------
Includes
-------- */
#include "triggers\trigger.h"
#include "triggers\trestart.h"
#ifndef __PLAYER_PLAYER_H__
#include "player\player.h"
#endif
/* Std Lib
------- */
/* Data
---- */
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
/*----------------------------------------------------------------------
Structure defintions
-------------------- */
/*----------------------------------------------------------------------
Function Prototypes
------------------- */
/*----------------------------------------------------------------------
Vars
---- */
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CRestartPointTrigger::collidedWith(CThing *_thisThing)
{
CRECT collisionArea;
DVECTOR respawnPos;
ASSERT(_thisThing->getThingType()==TYPE_PLAYER);
collisionArea=getCollisionArea();
respawnPos.vx=collisionArea.x1+((collisionArea.x2-collisionArea.x1)/2);
respawnPos.vy=collisionArea.y2;
((CPlayer*)_thisThing)->setRespawnPos(respawnPos);
}
/*===========================================================================
end */