This commit is contained in:
parent
9ad7e14f55
commit
5431e42a52
4 changed files with 24 additions and 10 deletions
|
@ -207,7 +207,8 @@ system_src := main \
|
|||
thing_src := thing
|
||||
|
||||
triggers_src := tlevexit \
|
||||
tlook
|
||||
tlook \
|
||||
trestart
|
||||
|
||||
utils_src := utils \
|
||||
sincos \
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
#include "triggers\tlevexit.h"
|
||||
#endif
|
||||
|
||||
#ifndef __TRIGGERS_TLOOK_H__
|
||||
#include "triggers\tlook.h"
|
||||
#ifndef __TRIGGERS_TRESTART_H__
|
||||
#include "triggers\trestart.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PICKUPS_PICKUP_H__
|
||||
|
@ -281,6 +281,7 @@ void CLevel::initLayers()
|
|||
}
|
||||
|
||||
// Triggers
|
||||
// Yeah yeah - I'll put this crap into a seperate file when the numbers of trigger types get a bit bigger! (pkg)
|
||||
if (LevelHdr->TriggerList)
|
||||
{
|
||||
sThingHdr *Hdr=(sThingHdr*)MakePtr(LevelHdr,LevelHdr->TriggerList);
|
||||
|
@ -298,9 +299,9 @@ PAUL_DBGMSG("%d triggers",TriggerCount);
|
|||
trigger=(CTriggerThing*)new ("LevelExitTrigger") CLevelExitTrigger();
|
||||
break;
|
||||
|
||||
// Look down trigger
|
||||
// Level respawn trigger
|
||||
case 1:
|
||||
trigger=(CTriggerThing*)new ("LookTrigger") CLookTrigger();
|
||||
trigger=(CRestartPointTrigger*)new ("RestartTrigger") CRestartPointTrigger();
|
||||
break;
|
||||
}
|
||||
trigger->init();
|
||||
|
|
|
@ -21,6 +21,10 @@
|
|||
#include "game\game.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PLAYER_PLAYER_H__
|
||||
#include "player\player.h"
|
||||
#endif
|
||||
|
||||
|
||||
/* Std Lib
|
||||
------- */
|
||||
|
@ -51,16 +55,16 @@
|
|||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CLevelExitTrigger::collidedWith(CThing *_thisThing)
|
||||
void CRestartPointTrigger::collidedWith(CThing *_thisThing)
|
||||
{
|
||||
CRect collisionSize;
|
||||
CRECT collisionArea;
|
||||
DVECTOR respawnPos;
|
||||
|
||||
ASSERT(_thisThing->getThingType()==TYPE_PLAYER);
|
||||
|
||||
collisionSize=getCollisionSize();
|
||||
respawnPos.vx=collisionSize.x1+((collisionSize.x2-collisionSize.x1)/2);
|
||||
respawnPos.vy=collisionSize.y2;
|
||||
collisionArea=getCollisionArea();
|
||||
respawnPos.vx=collisionArea.x1+((collisionArea.x2-collisionArea.x1)/2);
|
||||
respawnPos.vy=collisionArea.y2;
|
||||
((CPlayer*)_thisThing)->setRespawnPos(respawnPos);
|
||||
}
|
||||
|
||||
|
|
|
@ -1275,6 +1275,14 @@ SOURCE=..\..\..\source\triggers\tlook.cpp
|
|||
|
||||
SOURCE=..\..\..\source\triggers\tlook.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\source\triggers\trestart.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\source\triggers\trestart.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "utils"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue