diff --git a/makefile.gaz b/makefile.gaz index 04697e7d2..b0f0342b8 100644 --- a/makefile.gaz +++ b/makefile.gaz @@ -83,7 +83,8 @@ enemy_src := npc \ friend_src := friend \ fdata \ - fgary + fgary \ + fsquid platform_src := platform \ platdata \ diff --git a/source/friend/fsquid.h b/source/friend/fsquid.h index 02bbb3100..00124e274 100644 --- a/source/friend/fsquid.h +++ b/source/friend/fsquid.h @@ -20,6 +20,8 @@ class CNpcSquidwardFriend : public CNpcFriend { +public: + virtual void think(int _frames); }; #endif \ No newline at end of file diff --git a/source/platform/pbranch.cpp b/source/platform/pbranch.cpp index f28f28219..caa7b5ca7 100644 --- a/source/platform/pbranch.cpp +++ b/source/platform/pbranch.cpp @@ -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 ) diff --git a/source/platform/platform.cpp b/source/platform/platform.cpp index 4e181df45..dee4ded48 100644 --- a/source/platform/platform.cpp +++ b/source/platform/platform.cpp @@ -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; + } } } diff --git a/users/paul/spongebob project/spongebob project.dsp b/users/paul/spongebob project/spongebob project.dsp index 52bc57e59..6d6ce49ab 100644 --- a/users/paul/spongebob project/spongebob project.dsp +++ b/users/paul/spongebob project/spongebob project.dsp @@ -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