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
|
thing_src := thing
|
||||||
|
|
||||||
triggers_src := tlevexit \
|
triggers_src := tlevexit \
|
||||||
tlook
|
tlook \
|
||||||
|
trestart
|
||||||
|
|
||||||
utils_src := utils \
|
utils_src := utils \
|
||||||
sincos \
|
sincos \
|
||||||
|
|
|
@ -23,8 +23,8 @@
|
||||||
#include "triggers\tlevexit.h"
|
#include "triggers\tlevexit.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __TRIGGERS_TLOOK_H__
|
#ifndef __TRIGGERS_TRESTART_H__
|
||||||
#include "triggers\tlook.h"
|
#include "triggers\trestart.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __PICKUPS_PICKUP_H__
|
#ifndef __PICKUPS_PICKUP_H__
|
||||||
|
@ -281,6 +281,7 @@ void CLevel::initLayers()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Triggers
|
// 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)
|
if (LevelHdr->TriggerList)
|
||||||
{
|
{
|
||||||
sThingHdr *Hdr=(sThingHdr*)MakePtr(LevelHdr,LevelHdr->TriggerList);
|
sThingHdr *Hdr=(sThingHdr*)MakePtr(LevelHdr,LevelHdr->TriggerList);
|
||||||
|
@ -298,9 +299,9 @@ PAUL_DBGMSG("%d triggers",TriggerCount);
|
||||||
trigger=(CTriggerThing*)new ("LevelExitTrigger") CLevelExitTrigger();
|
trigger=(CTriggerThing*)new ("LevelExitTrigger") CLevelExitTrigger();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Look down trigger
|
// Level respawn trigger
|
||||||
case 1:
|
case 1:
|
||||||
trigger=(CTriggerThing*)new ("LookTrigger") CLookTrigger();
|
trigger=(CRestartPointTrigger*)new ("RestartTrigger") CRestartPointTrigger();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
trigger->init();
|
trigger->init();
|
||||||
|
|
|
@ -21,6 +21,10 @@
|
||||||
#include "game\game.h"
|
#include "game\game.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __PLAYER_PLAYER_H__
|
||||||
|
#include "player\player.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Std Lib
|
/* Std Lib
|
||||||
------- */
|
------- */
|
||||||
|
@ -51,16 +55,16 @@
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CLevelExitTrigger::collidedWith(CThing *_thisThing)
|
void CRestartPointTrigger::collidedWith(CThing *_thisThing)
|
||||||
{
|
{
|
||||||
CRect collisionSize;
|
CRECT collisionArea;
|
||||||
DVECTOR respawnPos;
|
DVECTOR respawnPos;
|
||||||
|
|
||||||
ASSERT(_thisThing->getThingType()==TYPE_PLAYER);
|
ASSERT(_thisThing->getThingType()==TYPE_PLAYER);
|
||||||
|
|
||||||
collisionSize=getCollisionSize();
|
collisionArea=getCollisionArea();
|
||||||
respawnPos.vx=collisionSize.x1+((collisionSize.x2-collisionSize.x1)/2);
|
respawnPos.vx=collisionArea.x1+((collisionArea.x2-collisionArea.x1)/2);
|
||||||
respawnPos.vy=collisionSize.y2;
|
respawnPos.vy=collisionArea.y2;
|
||||||
((CPlayer*)_thisThing)->setRespawnPos(respawnPos);
|
((CPlayer*)_thisThing)->setRespawnPos(respawnPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1275,6 +1275,14 @@ SOURCE=..\..\..\source\triggers\tlook.cpp
|
||||||
|
|
||||||
SOURCE=..\..\..\source\triggers\tlook.h
|
SOURCE=..\..\..\source\triggers\tlook.h
|
||||||
# End Source File
|
# 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
|
# End Group
|
||||||
# Begin Group "utils"
|
# Begin Group "utils"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue