This commit is contained in:
Paul 2001-06-11 15:27:05 +00:00
parent 898cecc036
commit dd94063c01
3 changed files with 22 additions and 2 deletions

View File

@ -741,7 +741,8 @@ if(newmode!=-1)
#ifdef __USER_paul__
if(PadGetDown(0)&PAD_TRIANGLE)
{
springPlayerUp();
CLevel &level=GameScene.GetLevel();
level.destroyMapTile(Pos);
}
#endif
///
@ -1356,6 +1357,24 @@ if(drawlastpos)
}
/*----------------------------------------------------------------------
Function:
Purpose: Like the normal setRespawnPos() but plays the telephone ring sound if
this is not the current respawn point. To be used from the respawn triggers
so that they make the ring sound
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayer::setRespawnPosAndRingTelephone(DVECTOR _respawn)
{
if(m_respawnPos.vx!=_respawn.vx&&
m_respawnPos.vy!=_respawn.vy)
{
CSoundMediator::playSfx(CSoundMediator::SFX_TELEPHONE_BOX);
setRespawnPos(_respawn);
}
}
/*----------------------------------------------------------------------
Function:
Purpose:

View File

@ -217,6 +217,7 @@ public:
void setCameraBox(CameraBox _cameraBox);
void setRespawnPos(DVECTOR _respawn) {m_respawnPos=_respawn;}
void setRespawnPosAndRingTelephone(DVECTOR _respawn);
// This isn't funny anymore.. :(
int getHeightFromGround(int _x,int _y,int _maxHeight=32);

View File

@ -64,7 +64,7 @@ void CRestartPointTrigger::collidedWith(CThing *_thisThing)
collisionArea=getCollisionArea();
respawnPos.vx=collisionArea.x1+((collisionArea.x2-collisionArea.x1)/2);
respawnPos.vy=collisionArea.y2;
((CPlayer*)_thisThing)->setRespawnPos(respawnPos);
((CPlayer*)_thisThing)->setRespawnPosAndRingTelephone(respawnPos);
break;
}