From 64c91504d65b5fa4ce3b6a97ca875ea3558138ea Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 15 Jun 2001 21:09:25 +0000 Subject: [PATCH] --- source/triggers/twinddown.cpp | 49 ++++++++++++++++++++++++++++++ source/triggers/twinddown.h | 55 ++++++++++++++++++++++++++++++++++ source/triggers/twindleft.cpp | 49 ++++++++++++++++++++++++++++++ source/triggers/twindleft.h | 55 ++++++++++++++++++++++++++++++++++ source/triggers/twindright.cpp | 49 ++++++++++++++++++++++++++++++ source/triggers/twindright.h | 55 ++++++++++++++++++++++++++++++++++ 6 files changed, 312 insertions(+) create mode 100644 source/triggers/twinddown.cpp create mode 100644 source/triggers/twinddown.h create mode 100644 source/triggers/twindleft.cpp create mode 100644 source/triggers/twindleft.h create mode 100644 source/triggers/twindright.cpp create mode 100644 source/triggers/twindright.h diff --git a/source/triggers/twinddown.cpp b/source/triggers/twinddown.cpp new file mode 100644 index 000000000..9a0d070a5 --- /dev/null +++ b/source/triggers/twinddown.cpp @@ -0,0 +1,49 @@ +/*========================================================================= + + twinddown.cpp + + Author: Charles Blair + Created: + Project: Spongebob + Purpose: + + Copyright (c) 2001 Climax Development Ltd + +===========================================================================*/ + +#ifndef __TRIGGERS_TWINDDOWN_H__ +#include "triggers\twinddown.h" +#endif + +#ifndef __PLAYER_PLAYER_H__ +#include "player\player.h" +#endif + +#ifndef __SYSTEM_GSTATE_H__ +#include "system\gstate.h" +#endif + + +void CWindDownTrigger::collidedWith(CThing *_thisThing) +{ + switch( _thisThing->getThingType() ) + { + case TYPE_PLAYER: + { + CPlayer *player = (CPlayer *) _thisThing; + + DVECTOR move; + move.vx = 0; + move.vy = 4 * GameState::getFramesSinceLast(); + + player->shove( move ); + player->setFloating(); + + break; + } + + default: + break; + } +} + diff --git a/source/triggers/twinddown.h b/source/triggers/twinddown.h new file mode 100644 index 000000000..33d9c6647 --- /dev/null +++ b/source/triggers/twinddown.h @@ -0,0 +1,55 @@ +/*========================================================================= + + twinddown.h + + Author: Charles Blair + Created: + Project: Spongebob + Purpose: + + Copyright (c) 2001 Climax Development Ltd + +===========================================================================*/ + +#ifndef __TRIGGERS_TWINDDOWN_H__ +#define __TRIGGERS_TWINDDOWN_H__ + +/*---------------------------------------------------------------------- + Includes + -------- */ + +#ifndef __TRIGGER_TRIGGER_HEADER__ +#include "triggers\trigger.h" +#endif + +/* Std Lib + ------- */ + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ + +class CWindDownTrigger : public CTrigger +{ +protected: + virtual void collidedWith(CThing *_thisThing); +}; + +/*---------------------------------------------------------------------- + Globals + ------- */ + +/*---------------------------------------------------------------------- + Functions + --------- */ + +/*---------------------------------------------------------------------- */ + +#endif + +/*=========================================================================== + end */ diff --git a/source/triggers/twindleft.cpp b/source/triggers/twindleft.cpp new file mode 100644 index 000000000..c52847fd0 --- /dev/null +++ b/source/triggers/twindleft.cpp @@ -0,0 +1,49 @@ +/*========================================================================= + + twindleft.cpp + + Author: Charles Blair + Created: + Project: Spongebob + Purpose: + + Copyright (c) 2001 Climax Development Ltd + +===========================================================================*/ + +#ifndef __TRIGGERS_TWINDLEFT_H__ +#include "triggers\twindleft.h" +#endif + +#ifndef __PLAYER_PLAYER_H__ +#include "player\player.h" +#endif + +#ifndef __SYSTEM_GSTATE_H__ +#include "system\gstate.h" +#endif + + +void CWindLeftTrigger::collidedWith(CThing *_thisThing) +{ + switch( _thisThing->getThingType() ) + { + case TYPE_PLAYER: + { + CPlayer *player = (CPlayer *) _thisThing; + + DVECTOR move; + move.vx = -4 * GameState::getFramesSinceLast(); + move.vy = 0; + + player->shove( move ); + player->setFloating(); + + break; + } + + default: + break; + } +} + diff --git a/source/triggers/twindleft.h b/source/triggers/twindleft.h new file mode 100644 index 000000000..75e9b0545 --- /dev/null +++ b/source/triggers/twindleft.h @@ -0,0 +1,55 @@ +/*========================================================================= + + twindleft.h + + Author: Charles Blair + Created: + Project: Spongebob + Purpose: + + Copyright (c) 2001 Climax Development Ltd + +===========================================================================*/ + +#ifndef __TRIGGERS_TWINDLEFT_H__ +#define __TRIGGERS_TWINDLEFT_H__ + +/*---------------------------------------------------------------------- + Includes + -------- */ + +#ifndef __TRIGGER_TRIGGER_HEADER__ +#include "triggers\trigger.h" +#endif + +/* Std Lib + ------- */ + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ + +class CWindLeftTrigger : public CTrigger +{ +protected: + virtual void collidedWith(CThing *_thisThing); +}; + +/*---------------------------------------------------------------------- + Globals + ------- */ + +/*---------------------------------------------------------------------- + Functions + --------- */ + +/*---------------------------------------------------------------------- */ + +#endif + +/*=========================================================================== + end */ diff --git a/source/triggers/twindright.cpp b/source/triggers/twindright.cpp new file mode 100644 index 000000000..44b7f81e9 --- /dev/null +++ b/source/triggers/twindright.cpp @@ -0,0 +1,49 @@ +/*========================================================================= + + twindright.cpp + + Author: Charles Blair + Created: + Project: Spongebob + Purpose: + + Copyright (c) 2001 Climax Development Ltd + +===========================================================================*/ + +#ifndef __TRIGGERS_TWINDRIGHT_H__ +#include "triggers\twindright.h" +#endif + +#ifndef __PLAYER_PLAYER_H__ +#include "player\player.h" +#endif + +#ifndef __SYSTEM_GSTATE_H__ +#include "system\gstate.h" +#endif + + +void CWindRightTrigger::collidedWith(CThing *_thisThing) +{ + switch( _thisThing->getThingType() ) + { + case TYPE_PLAYER: + { + CPlayer *player = (CPlayer *) _thisThing; + + DVECTOR move; + move.vx = 4 * GameState::getFramesSinceLast(); + move.vy = 0; + + player->shove( move ); + player->setFloating(); + + break; + } + + default: + break; + } +} + diff --git a/source/triggers/twindright.h b/source/triggers/twindright.h new file mode 100644 index 000000000..178770b53 --- /dev/null +++ b/source/triggers/twindright.h @@ -0,0 +1,55 @@ +/*========================================================================= + + twindright.h + + Author: Charles Blair + Created: + Project: Spongebob + Purpose: + + Copyright (c) 2001 Climax Development Ltd + +===========================================================================*/ + +#ifndef __TRIGGERS_TWINDRIGHT_H__ +#define __TRIGGERS_TWINDRIGHT_H__ + +/*---------------------------------------------------------------------- + Includes + -------- */ + +#ifndef __TRIGGER_TRIGGER_HEADER__ +#include "triggers\trigger.h" +#endif + +/* Std Lib + ------- */ + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ + +class CWindRightTrigger : public CTrigger +{ +protected: + virtual void collidedWith(CThing *_thisThing); +}; + +/*---------------------------------------------------------------------- + Globals + ------- */ + +/*---------------------------------------------------------------------- + Functions + --------- */ + +/*---------------------------------------------------------------------- */ + +#endif + +/*=========================================================================== + end */