This commit is contained in:
Charles 2001-05-25 19:08:35 +00:00
parent 68ca825123
commit 861c534304
8 changed files with 195 additions and 26 deletions

View file

@ -3,9 +3,9 @@
fgary.cpp
Author: CRB
Created:
Created:
Project: Spongebob
Purpose:
Purpose:
Copyright (c) 2000 Climax Development Ltd
@ -34,6 +34,19 @@ void CNpcGaryFriend::think( int _frames )
groundHeight = CGameScene::getCollision()->getHeightFromGround( Pos.vx, Pos.vy, yMovement + 16 );
if ( m_platform )
{
s32 platformHeight = m_platform->getHeightFromPlatformAtPosition( Pos.vx, Pos.vy );
if ( platformHeight < groundHeight )
{
groundHeight = platformHeight;
}
//Pos.vy += platformHeight;
//return;
}
if ( groundHeight <= 0 )
{
// groundHeight <= 0 indicates either on ground or below ground

View file

@ -3,9 +3,9 @@
friend.cpp
Author: CRB
Created:
Created:
Project: Spongebob
Purpose:
Purpose:
Copyright (c) 2000 Climax Development Ltd
@ -174,6 +174,7 @@ void CNpcFriend::init()
m_animNo = m_data[m_type].idleAnim;
m_frame = 0;
m_reversed = false;
m_platform = NULL;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -245,6 +246,7 @@ void CNpcFriend::render()
m_actorGfx->Render(renderPos,m_animNo,(m_frame>>8),m_reversed);
sBBox boundingBox = m_actorGfx->GetBBox();
boundingBox.YMax = 0;
setCollisionSize( ( boundingBox.XMax - boundingBox.XMin ), ( boundingBox.YMax - boundingBox.YMin ) );
setCollisionCentreOffset( ( boundingBox.XMax + boundingBox.XMin ) >> 1, ( boundingBox.YMax + boundingBox.YMin ) >> 1 );
}

View file

@ -3,9 +3,9 @@
friend.h
Author: CRB
Created:
Created:
Project: Spongebob
Purpose:
Purpose:
Copyright (c) 2000 Climax Development Ltd
@ -22,6 +22,10 @@
#include "player\player.h"
#endif
#ifndef __PLATFORM_PLATFORM_H__
#include "platform\platform.h"
#endif
class CNpcFriend : public CNpcThing
{
public:
@ -51,6 +55,8 @@ public:
void setType( NPC_FRIEND_UNIT_TYPE newType ) {m_type = newType;}
void setPlatform( CNpcPlatform *platform ) {m_platform = platform;}
void clearPlatform() {m_platform = NULL;}
static CNpcFriend *Create(sThingActor *ThisActor);
static NPC_FRIEND_UNIT_TYPE getTypeFromMapEdit( u16 newType );
@ -90,9 +96,10 @@ protected:
};
// internal variables
NPC_FRIEND_UNIT_TYPE m_type;
s32 m_extension;
CNpcPlatform *m_platform;
int m_frame;
int m_animNo;