This commit is contained in:
parent
97439c21e6
commit
6e672f0b3a
2 changed files with 63 additions and 0 deletions
34
source/platform/pcirculr.cpp
Normal file
34
source/platform/pcirculr.cpp
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*=========================================================================
|
||||
|
||||
pcirculr.cpp
|
||||
|
||||
Author: CRB
|
||||
Created:
|
||||
Project: Spongebob
|
||||
Purpose:
|
||||
|
||||
Copyright (c) 2001 Climax Development Ltd
|
||||
|
||||
===========================================================================*/
|
||||
|
||||
#ifndef __PLATFORM_PCIRCULR_H__
|
||||
#include "platform\pcirculr.h"
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CNpcCircularPlatform::postInit()
|
||||
{
|
||||
m_extension = 100;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CNpcCircularPlatform::processMovement( int _frames )
|
||||
{
|
||||
m_rotation += m_data[m_type].speed;
|
||||
m_rotation &= 4095;
|
||||
|
||||
Pos.vx = m_base.vx + ( ( m_extension * rcos( m_rotation ) ) >> 12 );
|
||||
Pos.vy = m_base.vy + ( ( m_extension * rsin( m_rotation ) ) >> 12 );
|
||||
}
|
29
source/platform/pcirculr.h
Normal file
29
source/platform/pcirculr.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*=========================================================================
|
||||
|
||||
pcirculr.h
|
||||
|
||||
Author: CRB
|
||||
Created:
|
||||
Project: Spongebob
|
||||
Purpose:
|
||||
|
||||
Copyright (c) 2001 Climax Development Ltd
|
||||
|
||||
===========================================================================*/
|
||||
|
||||
#ifndef __PLATFORM_PCIRCULR_H__
|
||||
#define __PLATFORM_PCIRCULR_H__
|
||||
|
||||
#ifndef __PLATFORM_PLATFORM_H__
|
||||
#include "platform\platform.h"
|
||||
#endif
|
||||
|
||||
class CNpcCircularPlatform : public CNpcPlatform
|
||||
{
|
||||
public:
|
||||
virtual void postInit();
|
||||
protected:
|
||||
virtual void processMovement( int _frames );
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue