This commit is contained in:
parent
64360d491d
commit
629e2b7c28
@ -335,7 +335,7 @@ CNpcPlatform::NPC_PLATFORM_DATA CNpcPlatform::m_data[NPC_PLATFORM_TYPE_MAX] =
|
||||
},
|
||||
|
||||
{ // NPC_STEERABLE_BARREL_PLATFORM
|
||||
2,
|
||||
3,
|
||||
128,
|
||||
true,
|
||||
DAMAGE__NONE,
|
||||
|
@ -56,13 +56,37 @@ void CNpcSteerableBarrelPlatform::processMovement( int _frames )
|
||||
{
|
||||
DVECTOR playerPos = player->getPos();
|
||||
|
||||
s32 playerX = playerPos.vx - this->Pos.vx;
|
||||
DVECTOR *playerVel = player->getMoveVelocity();
|
||||
|
||||
s32 speedChange = -playerVel->vx << 8;
|
||||
|
||||
if ( speedChange > ( _frames << 5 ) )
|
||||
{
|
||||
speedChange = _frames << 5;
|
||||
}
|
||||
else if ( speedChange < -( _frames << 5 ) )
|
||||
{
|
||||
speedChange = -_frames << 5;
|
||||
}
|
||||
|
||||
m_currentSpeed += speedChange;
|
||||
|
||||
if ( m_currentSpeed > ( m_speed << 8 ) )
|
||||
{
|
||||
m_currentSpeed = ( m_speed << 8 );
|
||||
}
|
||||
else if ( m_currentSpeed < -( m_speed << 8 ) )
|
||||
{
|
||||
m_currentSpeed = -( m_speed << 8 );
|
||||
}
|
||||
|
||||
/*s32 playerX = playerPos.vx - this->Pos.vx;
|
||||
|
||||
if ( playerX > 5 )
|
||||
{
|
||||
// increase barrel speed to right
|
||||
|
||||
m_currentSpeed += _frames;
|
||||
m_currentSpeed += _frames << 2;
|
||||
|
||||
if ( m_currentSpeed > ( m_speed << 8 ) )
|
||||
{
|
||||
@ -71,13 +95,13 @@ void CNpcSteerableBarrelPlatform::processMovement( int _frames )
|
||||
}
|
||||
else if ( playerX < -5 )
|
||||
{
|
||||
m_currentSpeed -= _frames;
|
||||
m_currentSpeed -= _frames << 2;
|
||||
|
||||
if ( m_currentSpeed < -( m_speed << 8 ) )
|
||||
{
|
||||
m_currentSpeed = -( m_speed << 8 );
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user