SBSPSS/source/platform/pbubble.cpp

60 lines
1.2 KiB
C++
Raw Normal View History

2001-04-23 18:54:49 +02:00
/*=========================================================================
pbubble.cpp
Author: CRB
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
#ifndef __PLATFORM_PBUBBLE_H__
#include "platform\pbubble.h"
#endif
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcBubblePlatform::processMovement( int _frames )
{
2001-05-22 22:39:46 +02:00
if ( !isSetToShutdown() )
2001-05-05 01:12:26 +02:00
{
2001-05-22 22:39:46 +02:00
Pos.vy -= m_speed * _frames;
if ( m_npcPath.getWaypointCount() > 1 )
{
s32 minY, maxY;
m_npcPath.getPathYExtents( &minY, &maxY );
if ( Pos.vy < minY )
{
setToShutdown();
}
}
else
{
if ( Pos.vy < 0 )
{
setToShutdown();
}
}
2001-05-05 01:12:26 +02:00
}
2001-05-22 21:59:56 +02:00
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const CRECT *CNpcBubblePlatform::getThinkBBox()
{
CRECT objThinkBox = getCollisionArea();
sBBox &thinkBBox = CThingManager::getThinkBBox();
objThinkBox.x1 = thinkBBox.XMin;
objThinkBox.x2 = thinkBBox.XMax;
objThinkBox.y1 = thinkBBox.YMin;
objThinkBox.y2 = thinkBBox.YMax;
return &objThinkBox;
2001-04-23 18:54:49 +02:00
}