This commit is contained in:
Charles 2001-04-24 21:48:20 +00:00
parent b5516f0c58
commit 5ffa10e470
2 changed files with 85 additions and 0 deletions

View File

@ -0,0 +1,54 @@
/*=========================================================================
ppendulm.cpp
Author: CRB
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
#ifndef __PLATFORM_PPENDULM_H__
#include "platform\ppendulm.h"
#endif
void CNpcPendulumPlatform::postInit()
{
m_extendDir = EXTEND_LEFT;
m_extension = 0;
m_heading = 1024;
m_length = 200;
}
void CNpcPendulumPlatform::processMovement( int _frames )
{
if ( m_extendDir == EXTEND_LEFT )
{
if ( m_extension > 512 )
{
m_extendDir = EXTEND_RIGHT;
}
else
{
m_extension += _frames << 3;
}
}
else
{
if ( m_extension < -512 )
{
m_extendDir = EXTEND_LEFT;
}
else
{
m_extension -= _frames << 3;
}
}
Pos.vx = m_base.vx + ( ( m_length * rcos( m_heading + m_extension ) ) >> 12 );
Pos.vy = m_base.vy + ( ( m_length * rsin( m_heading + m_extension ) ) >> 12 );
}

View File

@ -0,0 +1,31 @@
/*=========================================================================
ppendulm.h
Author: CRB
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
#ifndef __PLATFORM_PPENDULM_H__
#define __PLATFORM_PPENDULM_H__
#ifndef __PLATFORM_PLATFORM_H__
#include "platform\platform.h"
#endif
class CNpcPendulumPlatform : public CNpcPlatform
{
public:
virtual void postInit();
protected:
virtual void processMovement( int _frames );
s32 m_length;
};
#endif