SBSPSS/source/triggers/trestart.cpp
2001-04-23 21:11:15 +00:00

73 lines
1.6 KiB
C++

/*=========================================================================
trestart.cpp
Author: PKG
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
/*----------------------------------------------------------------------
Includes
-------- */
#include "triggers\trestart.h"
#ifndef __GAME_GAME_H__
#include "game\game.h"
#endif
#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 */