This commit is contained in:
parent
fe09f84333
commit
6742515647
4 changed files with 27 additions and 12 deletions
|
@ -46,7 +46,7 @@ void CNpcSteerableOildrumPlatform::processMovement( int _frames )
|
|||
{
|
||||
DVECTOR playerPos = player->getPos();
|
||||
|
||||
DVECTOR *playerVel = player->getMoveVelocity();
|
||||
s32 playerMovement = player->getMovement();
|
||||
|
||||
/*s32 speedChange = -playerVel->vx << 8;
|
||||
|
||||
|
@ -70,7 +70,8 @@ void CNpcSteerableOildrumPlatform::processMovement( int _frames )
|
|||
m_currentSpeed = -( m_speed << 8 );
|
||||
}*/
|
||||
|
||||
m_currentSpeed = -playerVel->vx << 4;
|
||||
//m_currentSpeed = -playerVel->vx << 4;
|
||||
m_currentSpeed = -playerMovement;
|
||||
|
||||
/*s32 playerX = playerPos.vx - this->Pos.vx;
|
||||
|
||||
|
@ -120,17 +121,17 @@ void CNpcSteerableOildrumPlatform::processMovement( int _frames )
|
|||
moveX = m_moveXHighRes >> 8;
|
||||
m_moveXHighRes -= moveX << 8;*/
|
||||
|
||||
moveX = ( m_currentSpeed * _frames ) >> 8;
|
||||
moveX = m_currentSpeed;
|
||||
|
||||
// check for collision
|
||||
|
||||
if ( CGameScene::getCollision()->getHeightFromGround( Pos.vx + moveX, Pos.vy + 20 ) < -maxHeight )
|
||||
if ( CGameScene::getCollision()->getHeightFromGround( Pos.vx + moveX, Pos.vy ) < -maxHeight )
|
||||
{
|
||||
moveX = 0;
|
||||
m_currentSpeed = 0;
|
||||
}
|
||||
|
||||
m_rotation += ( m_currentSpeed * 30 * _frames ) >> 10;
|
||||
m_rotation += ( m_currentSpeed * 30 * _frames ) >> 2;
|
||||
m_rotation &= 4095;
|
||||
|
||||
if ( m_contact )
|
||||
|
@ -143,7 +144,7 @@ void CNpcSteerableOildrumPlatform::processMovement( int _frames )
|
|||
|
||||
// check for vertical movement
|
||||
|
||||
groundHeight = CGameScene::getCollision()->getHeightFromGround( Pos.vx + moveX, Pos.vy + 20, yMovement + 16 );
|
||||
groundHeight = CGameScene::getCollision()->getHeightFromGround( Pos.vx + moveX, Pos.vy, yMovement + 16 );
|
||||
|
||||
if ( groundHeight <= yMovement )
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue