69 lines
1.5 KiB
C++
69 lines
1.5 KiB
C++
/*=========================================================================
|
|
|
|
trestart.cpp
|
|
|
|
Author: PKG
|
|
Created:
|
|
Project: Spongebob
|
|
Purpose:
|
|
|
|
Copyright (c) 2001 Climax Development Ltd
|
|
|
|
===========================================================================*/
|
|
|
|
/*----------------------------------------------------------------------
|
|
Includes
|
|
-------- */
|
|
|
|
#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 */
|