This commit is contained in:
parent
ec4f5f9375
commit
a8a436a7a0
6 changed files with 34 additions and 3 deletions
|
@ -239,7 +239,7 @@ void CGameScene::think(int _frames)
|
||||||
else if(s_levelFinished)
|
else if(s_levelFinished)
|
||||||
{
|
{
|
||||||
s_globalLevelSelectThing++;
|
s_globalLevelSelectThing++;
|
||||||
// s_globalLevelSelectThing&=3;
|
s_globalLevelSelectThing&=3; // Ch1 only Bodge
|
||||||
|
|
||||||
shutdownLevel();
|
shutdownLevel();
|
||||||
initLevel();
|
initLevel();
|
||||||
|
|
|
@ -315,6 +315,7 @@ void CLevel::initLayers()
|
||||||
trigger->init();
|
trigger->init();
|
||||||
trigger->setPositionAndSize(TriggerList->Pos.X<<4,TriggerList->Pos.Y<<4,
|
trigger->setPositionAndSize(TriggerList->Pos.X<<4,TriggerList->Pos.Y<<4,
|
||||||
TriggerList->Width<<4,TriggerList->Height<<4);
|
TriggerList->Width<<4,TriggerList->Height<<4);
|
||||||
|
trigger->setTargetPos(TriggerList->TargetPos.X<<4,TriggerList->TargetPos.Y<<4);
|
||||||
TriggerList++;
|
TriggerList++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,6 +165,8 @@ void CNpcBranchPlatform::processMovement( int _frames )
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int BX=-20;
|
||||||
|
int BY=-30;
|
||||||
void CNpcBranchPlatform::render()
|
void CNpcBranchPlatform::render()
|
||||||
{
|
{
|
||||||
if ( m_isActive )
|
if ( m_isActive )
|
||||||
|
@ -188,11 +190,15 @@ void CNpcBranchPlatform::render()
|
||||||
{
|
{
|
||||||
rotation.vy = 0;
|
rotation.vy = 0;
|
||||||
rotation.vz = getCollisionAngle();
|
rotation.vz = getCollisionAngle();
|
||||||
|
renderPos.vx-= BX;
|
||||||
|
renderPos.vy+= BY;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rotation.vy = 2048;
|
rotation.vy = 2048;
|
||||||
rotation.vz = -getCollisionAngle();
|
rotation.vz = -getCollisionAngle();
|
||||||
|
renderPos.vx+= BX;
|
||||||
|
renderPos.vy+= BY;
|
||||||
}
|
}
|
||||||
|
|
||||||
VECTOR scale;
|
VECTOR scale;
|
||||||
|
|
|
@ -875,5 +875,17 @@ void CTriggerThing::setPositionAndSize(int _x,int _y,int _w,int _h)
|
||||||
setCollisionSize(_w,_h);
|
setCollisionSize(_w,_h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
void CTriggerThing::setTargetPos(int _x,int _y)
|
||||||
|
{
|
||||||
|
TargetPos.vx=_x;
|
||||||
|
TargetPos.vy=_y;
|
||||||
|
}
|
||||||
|
|
||||||
/*===========================================================================
|
/*===========================================================================
|
||||||
end */
|
end */
|
||||||
|
|
|
@ -216,6 +216,8 @@ class CTriggerThing : public CThing
|
||||||
public:
|
public:
|
||||||
virtual TYPE getThingType() {return TYPE_TRIGGER;}
|
virtual TYPE getThingType() {return TYPE_TRIGGER;}
|
||||||
virtual void setPositionAndSize(int _x,int _y,int _w,int _h); // Wonder if this might be better in CThing? (pkg)
|
virtual void setPositionAndSize(int _x,int _y,int _w,int _h); // Wonder if this might be better in CThing? (pkg)
|
||||||
|
virtual void setTargetPos(int _x,int _y); // Wonder if this might be better in CThing? (pkg)
|
||||||
|
DVECTOR TargetPos;
|
||||||
};
|
};
|
||||||
class CHazardThing : public CThing
|
class CHazardThing : public CThing
|
||||||
{
|
{
|
||||||
|
|
|
@ -53,6 +53,16 @@
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CTeleportTrigger::collidedWith(CThing *_thisThing)
|
void CTeleportTrigger::collidedWith(CThing *_thisThing)
|
||||||
{
|
{
|
||||||
|
CRECT collisionArea;
|
||||||
|
DVECTOR respawnPos;
|
||||||
|
|
||||||
|
ASSERT(_thisThing->getThingType()==TYPE_PLAYER);
|
||||||
|
|
||||||
|
collisionArea=getCollisionArea();
|
||||||
|
respawnPos.vx=collisionArea.x1+((collisionArea.x2-collisionArea.x1)/2);
|
||||||
|
respawnPos.vy=collisionArea.y2;
|
||||||
|
((CPlayer*)_thisThing)->setPos(TargetPos);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
CRECT collisionArea;
|
CRECT collisionArea;
|
||||||
DVECTOR respawnPos;
|
DVECTOR respawnPos;
|
||||||
|
|
Loading…
Add table
Reference in a new issue