This commit is contained in:
parent
96783e0cff
commit
567c9b5b7d
2 changed files with 136 additions and 0 deletions
76
source/triggers/tlevexit.cpp
Normal file
76
source/triggers/tlevexit.cpp
Normal file
|
@ -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 */
|
60
source/triggers/tlevexit.h
Normal file
60
source/triggers/tlevexit.h
Normal file
|
@ -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 */
|
Loading…
Add table
Add a link
Reference in a new issue