From 567c9b5b7ddbe094a43aab1cd858344dab1b2ca4 Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 5 Mar 2001 19:29:48 +0000 Subject: [PATCH] --- source/triggers/tlevexit.cpp | 76 ++++++++++++++++++++++++++++++++++++ source/triggers/tlevexit.h | 60 ++++++++++++++++++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 source/triggers/tlevexit.cpp create mode 100644 source/triggers/tlevexit.h diff --git a/source/triggers/tlevexit.cpp b/source/triggers/tlevexit.cpp new file mode 100644 index 000000000..782dfd41c --- /dev/null +++ b/source/triggers/tlevexit.cpp @@ -0,0 +1,76 @@ +/*========================================================================= + + tlevexit.cpp + + Author: PKG + Created: + Project: Spongebob + Purpose: + + Copyright (c) 2001 Climax Development Ltd + +===========================================================================*/ + +/*---------------------------------------------------------------------- + Includes + -------- */ + +#include "triggers\tlevexit.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::setExitPosition(int _x,int _y,int _w,int _h) +{ + Pos.vx=_x+(_w/2); + Pos.vy=_y+(_h/2); + setCollisionSize(_w,_h); +} + + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void CLevelExitTrigger::collidedWith(CThing *_thisThing) +{ + ASSERT(_thisThing->getThingType()==TYPE_PLAYER); + + CGameScene::levelFinished(); +} + + +/*=========================================================================== +end */ diff --git a/source/triggers/tlevexit.h b/source/triggers/tlevexit.h new file mode 100644 index 000000000..29c4fd423 --- /dev/null +++ b/source/triggers/tlevexit.h @@ -0,0 +1,60 @@ +/*========================================================================= + + tlevexit.h + + Author: PKG + Created: + Project: Spongebob + Purpose: + + Copyright (c) 2001 Climax Development Ltd + +===========================================================================*/ + +#ifndef __TRIGGERS_TLEVEXIT_H__ +#define __TRIGGERS_TLEVEXIT_H__ + +/*---------------------------------------------------------------------- + Includes + -------- */ + +#ifndef __THING_THING_H__ +#include "thing/thing.h" +#endif + + +/* Std Lib + ------- */ + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ + +class CLevelExitTrigger : public CTriggerThing +{ +public: + void setExitPosition(int _x,int _y,int _w,int _h); + +protected: + virtual void collidedWith(CThing *_thisThing); + +}; + +/*---------------------------------------------------------------------- + Globals + ------- */ + +/*---------------------------------------------------------------------- + Functions + --------- */ + +/*---------------------------------------------------------------------- */ + +#endif /* __TRIGGERS_TLEVEXIT_H__ */ + +/*=========================================================================== + end */