diff --git a/source/triggers/trestart.cpp b/source/triggers/trestart.cpp new file mode 100644 index 000000000..20d97b722 --- /dev/null +++ b/source/triggers/trestart.cpp @@ -0,0 +1,68 @@ +/*========================================================================= + + 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 + + +/* Std Lib + ------- */ + +/* Data + ---- */ + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ + +/*---------------------------------------------------------------------- + Function Prototypes + ------------------- */ + +/*---------------------------------------------------------------------- + Vars + ---- */ + + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void CLevelExitTrigger::collidedWith(CThing *_thisThing) +{ + CRect collisionSize; + DVECTOR respawnPos; + + ASSERT(_thisThing->getThingType()==TYPE_PLAYER); + + collisionSize=getCollisionSize(); + respawnPos.vx=collisionSize.x1+((collisionSize.x2-collisionSize.x1)/2); + respawnPos.vy=collisionSize.y2; + ((CPlayer*)_thisThing)->setRespawnPos(respawnPos); +} + +/*=========================================================================== +end */ diff --git a/source/triggers/trestart.h b/source/triggers/trestart.h new file mode 100644 index 000000000..3687ecf18 --- /dev/null +++ b/source/triggers/trestart.h @@ -0,0 +1,57 @@ +/*========================================================================= + + trestart.h + + Author: PKG + Created: + Project: Spongebob + Purpose: + + Copyright (c) 2001 Climax Development Ltd + +===========================================================================*/ + +#ifndef __TRIGGERS_TRESTART_H__ +#define __TRIGGERS_TRESTART_H__ + +/*---------------------------------------------------------------------- + Includes + -------- */ + +#ifndef __THING_THING_H__ +#include "thing/thing.h" +#endif + + +/* Std Lib + ------- */ + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ + +class CRestartPointTrigger : public CTriggerThing +{ +protected: + virtual void collidedWith(CThing *_thisThing); + +}; + +/*---------------------------------------------------------------------- + Globals + ------- */ + +/*---------------------------------------------------------------------- + Functions + --------- */ + +/*---------------------------------------------------------------------- */ + +#endif /* __TRIGGERS_TRESTART_H__ */ + +/*=========================================================================== + end */