This commit is contained in:
parent
7d452d74b6
commit
64c91504d6
6 changed files with 312 additions and 0 deletions
49
source/triggers/twinddown.cpp
Normal file
49
source/triggers/twinddown.cpp
Normal file
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
55
source/triggers/twinddown.h
Normal file
55
source/triggers/twinddown.h
Normal file
|
@ -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 */
|
49
source/triggers/twindleft.cpp
Normal file
49
source/triggers/twindleft.cpp
Normal file
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
55
source/triggers/twindleft.h
Normal file
55
source/triggers/twindleft.h
Normal file
|
@ -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 */
|
49
source/triggers/twindright.cpp
Normal file
49
source/triggers/twindright.cpp
Normal file
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
55
source/triggers/twindright.h
Normal file
55
source/triggers/twindright.h
Normal file
|
@ -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 */
|
Loading…
Add table
Reference in a new issue