This commit is contained in:
Charles 2001-05-01 19:36:24 +00:00
parent cbf112d17b
commit 8c2034cd84
5 changed files with 42 additions and 6 deletions

View file

@ -83,7 +83,8 @@ enemy_src := npc \
friend_src := friend \
fdata \
fgary
fgary \
fsquid
platform_src := platform \
platdata \

View file

@ -20,6 +20,8 @@
class CNpcSquidwardFriend : public CNpcFriend
{
public:
virtual void think(int _frames);
};
#endif

View file

@ -83,10 +83,27 @@ void CNpcBranchPlatform::processMovement( int _frames )
if ( m_contact )
{
if ( ( m_reversed && newAngle < -256 ) || newAngle > 256 )
{
//if ( ( m_reversed && newAngle < -256 ) || newAngle > 256 )
//{
// flick player upwards
GameScene.getPlayer()->springPlayerUp();
//GameScene.getPlayer()->springPlayerUp();
//}
CPlayer *player = GameScene.getPlayer();
if ( m_reversed )
{
if ( m_angularVelocity > 20 && newAngle < -64 )
{
player->springPlayerUp();
}
}
else
{
if ( m_angularVelocity < -20 && newAngle > 64 )
{
player->springPlayerUp();
}
}
s16 angularForce = 3 * _frames;
@ -99,7 +116,7 @@ void CNpcBranchPlatform::processMovement( int _frames )
m_angularVelocity += angularForce;
}
s32 resistance = -( 10 * newAngle ) >> 8;
s32 resistance = -( 5 * _frames * newAngle ) >> 8;
if ( newAngle > 0 && resistance > -2 )
{
@ -119,6 +136,15 @@ void CNpcBranchPlatform::processMovement( int _frames )
if ( m_angularVelocity )
{
m_angularVelocity += -m_angularVelocity / abs( m_angularVelocity );
if ( m_angularVelocity > 40 )
{
m_angularVelocity = 40;
}
else if ( m_angularVelocity < -40 )
{
m_angularVelocity = -40;
}
}
/*if ( newAngle > 320 )

View file

@ -698,7 +698,10 @@ void CNpcPlatform::collidedWith( CThing *_thisThing )
{
player->setPlatform( this );
m_contact = true;
if(getHeightFromPlatformAtPosition(playerPos.vx,playerPos.vy)==0)
{
m_contact = true;
}
}
}

View file

@ -441,6 +441,10 @@ SOURCE=..\..\..\source\friend\fsandy.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\friend\fsquid.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\friend\fsquid.h
# End Source File
# End Group