This commit is contained in:
Charles 2001-06-05 20:44:30 +00:00
parent f9286f6ad3
commit dec9d1139a
9 changed files with 119 additions and 1 deletions

View File

@ -129,7 +129,8 @@ platform_src := platform \
ptrpdoor \
pconveyr \
pplayer \
pcbubble
pcbubble \
pdrop
hazard_src := hazard \
hfalling \

52
source/platform/pdrop.cpp Normal file
View 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;
}

29
source/platform/pdrop.h Normal file
View File

@ -0,0 +1,29 @@
/*=========================================================================
pdrop.h
Author: CRB
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
#ifndef __PLATFORM_PDROP_H__
#define __PLATFORM_PDROP_H__
#ifndef __PLATFORM_PLATFORM_H__
#include "platform\platform.h"
#endif
class CNpcDropPlatform : public CNpcPlatform
{
public:
virtual CRECT const *getThinkBBox();
protected:
virtual void processMovement( int _frames );
};
#endif

View File

@ -466,6 +466,18 @@ CNpcPlatform::NPC_PLATFORM_DATA CNpcPlatform::m_data[NPC_PLATFORM_TYPE_MAX] =
0,
NPC_PLATFORM_TIMER_NONE,
},
{ // NPC_DROP_PLATFORM
6,
128,
true,
DAMAGE__NONE,
0,
2,
NPC_PLATFORM_INFINITE_LIFE,
0,
NPC_PLATFORM_TIMER_NONE,
},
};
CNpcPlatform::NPC_PLATFORM_UNIT_TYPE CNpcPlatform::mapEditConvertTable[NPC_PLATFORM_TYPE_MAX] =
@ -502,6 +514,7 @@ CNpcPlatform::NPC_PLATFORM_UNIT_TYPE CNpcPlatform::mapEditConvertTable[NPC_PLATF
NPC_TRAPDOOR_PLATFORM,
NPC_CONVEYOR_GENERATOR,
NPC_COLLAPSING_ACRID_PLATFORM,
NPC_DROP_PLATFORM,
NPC_CONVEYOR_PLATFORM,
NPC_PLAYER_BUBBLE_PLATFORM,
NPC_CLAM_PLATFORM,

View File

@ -171,6 +171,10 @@
#include "platform\pfallnor.h"
#endif
#ifndef __PLATFORM_PDROP_H__
#include "platform\pdrop.h"
#endif
#include "fx\fx.h"
#include "fx\fxjfish.h"
@ -391,6 +395,12 @@ CNpcPlatform *CNpcPlatform::Create(int Type)
break;
}
case NPC_DROP_PLATFORM:
{
platform = new ("drop platform") CNpcDropPlatform;
break;
}
default:
{
ASSERT( 0 );

View File

@ -89,6 +89,7 @@ public:
NPC_PLAYER_BUBBLE_PLATFORM,
NPC_CLAM_PLATFORM,
NPC_COLLAPSING_ACRID_PLATFORM,
NPC_DROP_PLATFORM,
NPC_PLATFORM_TYPE_MAX,
};
enum

View File

@ -121,6 +121,7 @@ DualGreenPlatform=16
AcridBubble=31
LeafRaft=19
OilRigPlatform=1
RockBridge=32
################################################
# Triggers

View File

@ -136,3 +136,6 @@ Gfx=..\..\Graphics\platforms\Leaf\Leaf.gin
[OilRigPlatform]
Gfx=..\..\Graphics\platforms\oilrig\oilrigplatform.gin
[RockBridge]
Gfx=..\..\Graphics\platforms\rockbridge\rockbridge.gin

View File

@ -1465,6 +1465,14 @@ SOURCE=..\..\..\source\platform\pconveyr.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\platform\pdrop.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\platform\pdrop.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\platform\pdual.cpp
# End Source File
# Begin Source File