SBSPSS/source/triggers/trestart.cpp

79 lines
1.6 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-07-23 21:26:37 +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:
{
2001-07-23 21:26:37 +02:00
CRECT const &collisionArea=getCollisionArea();
2001-06-04 14:54:44 +02:00
respawnPos.vx=collisionArea.x1+((collisionArea.x2-collisionArea.x1)/2);
respawnPos.vy=collisionArea.y2;
2001-07-18 18:09:39 +02:00
((CPlayer*)_thisThing)->setRespawnPos(respawnPos);
2001-06-04 14:54:44 +02:00
break;
}
default:
break;
}
2001-04-23 22:10:53 +02:00
}
/*===========================================================================
end */