This commit is contained in:
parent
5e9f391bba
commit
210a9e3364
1 changed files with 63 additions and 0 deletions
63
source/platform/pretract.cpp
Normal file
63
source/platform/pretract.cpp
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
/*=========================================================================
|
||||||
|
|
||||||
|
pretract.cpp
|
||||||
|
|
||||||
|
Author: CRB
|
||||||
|
Created:
|
||||||
|
Project: Spongebob
|
||||||
|
Purpose:
|
||||||
|
|
||||||
|
Copyright (c) 2001 Climax Development Ltd
|
||||||
|
|
||||||
|
===========================================================================*/
|
||||||
|
|
||||||
|
#ifndef __PLATFORM_PRETRACT_H__
|
||||||
|
#include "platform\pretract.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void CNpcRetractingPlatform::postInit()
|
||||||
|
{
|
||||||
|
m_timer = NPC_PLATFORM_TIMER_RETRACT;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void CNpcRetractingPlatform::processTimer( int _frames )
|
||||||
|
{
|
||||||
|
switch( m_timerType )
|
||||||
|
{
|
||||||
|
case NPC_PLATFORM_TIMER_RETRACT:
|
||||||
|
{
|
||||||
|
if ( m_timer > 0 )
|
||||||
|
{
|
||||||
|
m_timer -= _frames;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_timer = 4 * GameState::getOneSecondInFrames();
|
||||||
|
m_timerType = NPC_PLATFORM_TIMER_EXTEND;
|
||||||
|
m_detectCollision = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case NPC_PLATFORM_TIMER_EXTEND:
|
||||||
|
{
|
||||||
|
if ( m_timer > 0 )
|
||||||
|
{
|
||||||
|
m_timer -= _frames;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_timer = 4 * GameState::getOneSecondInFrames();
|
||||||
|
m_timerType = NPC_PLATFORM_TIMER_RETRACT;
|
||||||
|
m_detectCollision = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue