This commit is contained in:
parent
f9286f6ad3
commit
dec9d1139a
9 changed files with 119 additions and 1 deletions
52
source/platform/pdrop.cpp
Normal file
52
source/platform/pdrop.cpp
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*=========================================================================
|
||||
|
||||
pdrop.cpp
|
||||
|
||||
Author: CRB
|
||||
Created:
|
||||
Project: Spongebob
|
||||
Purpose:
|
||||
|
||||
Copyright (c) 2001 Climax Development Ltd
|
||||
|
||||
===========================================================================*/
|
||||
|
||||
#ifndef __PLATFORM_PDROP_H__
|
||||
#include "platform\pdrop.h"
|
||||
#endif
|
||||
|
||||
#ifndef __GAME_GAME_H__
|
||||
#include "game\game.h"
|
||||
#endif
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CNpcDropPlatform::processMovement( int _frames )
|
||||
{
|
||||
s32 moveY = m_speed * _frames;
|
||||
|
||||
s32 groundHeight = CGameScene::getCollision()->getHeightFromGround( Pos.vx, Pos.vy + moveY, 16 );
|
||||
|
||||
if ( groundHeight < moveY )
|
||||
{
|
||||
moveY = groundHeight;
|
||||
}
|
||||
|
||||
Pos.vy += moveY;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const CRECT *CNpcDropPlatform::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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue