This commit is contained in:
Charles 2001-05-23 21:27:29 +00:00
parent d04702d6a5
commit d3c0e5904a
8 changed files with 87 additions and 25 deletions

View File

@ -123,7 +123,8 @@ platform_src := platform \
pjellfsh \
pclam \
pfishhk3 \
prbridge
prbridge \
pbaloon
hazard_src := hazard \
hfalling \
@ -483,7 +484,7 @@ ifeq ($(USER_NAME),CDBUILD)
@$(CP) -u Data/CdData/$(TERRITORY).ccs $(CD_BUILD_DIR)/$(TERRITORY).ccs
@$(CP) -u Data/CdData/thq.str $(CD_DIR)/thq.str
@$(CP) -u Data/CdData/intro.str $(CD_DIR)/intro.str
@$(CP) -u Data/CdData/track1.ixa $(CD_DIR)/track1.ixa
@$(CP) -u Data/CdData/track1.ixa $(CD_DIR)/track1.ixa
@$(RAR) x data/CDData/ZZZZZZZ.RAR $(CD_DIR)/ -y >nul
@$(ECHO) HERE

View File

@ -383,6 +383,18 @@ CNpcPlatform::NPC_PLATFORM_DATA CNpcPlatform::m_data[NPC_PLATFORM_TYPE_MAX] =
NPC_PLATFORM_TIMER_NONE,
},
{ // NPC_BALLOON_BRIDGE_PLATFORM
3,
128,
true,
DAMAGE__NONE,
0,
4,
NPC_PLATFORM_INFINITE_LIFE,
0,
NPC_PLATFORM_TIMER_NONE,
},
{ // NPC_PLAYER_BUBBLE_PLATFORM
3,
128,
@ -438,6 +450,7 @@ CNpcPlatform::NPC_PLATFORM_UNIT_TYPE CNpcPlatform::mapEditConvertTable[NPC_PLATF
NPC_JELLYFISH_PLATFORM,
NPC_FISH_HOOK_3_PLATFORM,
NPC_RISING_BRIDGE_PLATFORM,
NPC_BALLOON_BRIDGE_PLATFORM,
NPC_PLAYER_BUBBLE_PLATFORM,
NPC_CLAM_PLATFORM,
};

View File

@ -151,6 +151,10 @@
#include "platform\prbridge.h"
#endif
#ifndef __PLATFORM_PBALOON_H__
#include "platform\pbaloon.h"
#endif
#include "fx\fx.h"
#include "fx\fxjfish.h"
@ -354,6 +358,12 @@ CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
break;
}
case NPC_BALLOON_BRIDGE_PLATFORM:
{
platform = new ("balloon bridge platform") CNpcBalloonBridgePlatform;
break;
}
default:
{
ASSERT( 0 );
@ -991,33 +1001,42 @@ void CNpcPlatform::render()
int CNpcPlatform::checkCollisionAgainst(CThing *_thisThing, int _frames)
{
int collided = false;
if ( m_detectCollision && m_isActive && !isSetToShutdown() )
switch(_thisThing->getThingType())
{
CRECT thisRect, thatRect;
case TYPE_PLAYERPROJECTILE:
return( false );
thisRect = getCollisionArea();
thatRect = _thisThing->getCollisionArea();
DVECTOR posDelta = getPosDelta();
thisRect.y1 -= abs( posDelta.vy ) >> 1;
thisRect.y2 += abs( posDelta.vy ) >> 1;
posDelta = _thisThing->getPosDelta();
thatRect.y1 -= abs( posDelta.vy ) >> 1;
thatRect.y2 += abs( posDelta.vy ) >> 1;
if(((thisRect.x1>=thatRect.x1&&thisRect.x1<=thatRect.x2)||(thisRect.x2>=thatRect.x1&&thisRect.x2<=thatRect.x2)||(thisRect.x1<=thatRect.x1&&thisRect.x2>=thatRect.x2))&&
((thisRect.y1>=thatRect.y1&&thisRect.y1<=thatRect.y2)||(thisRect.y2>=thatRect.y1&&thisRect.y2<=thatRect.y2)||(thisRect.y1<=thatRect.y1&&thisRect.y2>=thatRect.y2)))
default:
{
collided = true;
int collided = false;
if ( m_detectCollision && m_isActive && !isSetToShutdown() )
{
CRECT thisRect, thatRect;
thisRect = getCollisionArea();
thatRect = _thisThing->getCollisionArea();
DVECTOR posDelta = getPosDelta();
thisRect.y1 -= abs( posDelta.vy ) >> 1;
thisRect.y2 += abs( posDelta.vy ) >> 1;
posDelta = _thisThing->getPosDelta();
thatRect.y1 -= abs( posDelta.vy ) >> 1;
thatRect.y2 += abs( posDelta.vy ) >> 1;
if(((thisRect.x1>=thatRect.x1&&thisRect.x1<=thatRect.x2)||(thisRect.x2>=thatRect.x1&&thisRect.x2<=thatRect.x2)||(thisRect.x1<=thatRect.x1&&thisRect.x2>=thatRect.x2))&&
((thisRect.y1>=thatRect.y1&&thisRect.y1<=thatRect.y2)||(thisRect.y2>=thatRect.y1&&thisRect.y2<=thatRect.y2)||(thisRect.y1<=thatRect.y1&&thisRect.y2>=thatRect.y2)))
{
collided = true;
}
}
return( collided );
}
}
return( collided );
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -82,6 +82,7 @@ public:
NPC_JELLYFISH_PLATFORM,
NPC_FISH_HOOK_3_PLATFORM,
NPC_RISING_BRIDGE_PLATFORM,
NPC_BALLOON_BRIDGE_PLATFORM,
NPC_PLAYER_BUBBLE_PLATFORM,
NPC_CLAM_PLATFORM,
NPC_PLATFORM_TYPE_MAX,
@ -91,7 +92,7 @@ public:
void init( DVECTOR initPos );
void init( DVECTOR initPos, s32 initLifetime );
virtual void postInit();
void shutdown();
virtual void shutdown();
virtual void think(int _frames);
virtual void render();
virtual u8 canDrop() {return true;}

View File

@ -441,6 +441,22 @@ DVECTOR const &CamPos=CLevel::getCameraPos();
thing1 = thing1->m_nextCollisionThing;
}
// Platform -> Player projectile collision
thing1=s_CollisionLists[CThing::TYPE_PLATFORM];
while(thing1)
{
thing2=s_CollisionLists[CThing::TYPE_PLAYERPROJECTILE];
while(thing2)
{
if(thing1->checkCollisionAgainst(thing2, _frames))
{
thing1->collidedWith(thing2);
}
thing2=thing2->m_nextCollisionThing;
}
thing1=thing1->m_nextCollisionThing;
}
}
// Shut emm down, sh sh shut em down, we shutem down
for(i=0;i<CThing::MAX_TYPE;i++)

View File

@ -111,6 +111,7 @@ RockGeyser=7
Retracting=6
RollingOildrumPlatform=24
RisingBridge=27
BalloonBridge=28
################################################
# Triggers

View File

@ -108,3 +108,6 @@ Gfx=..\..\Graphics\platforms\rolling_oildrum\roll_oil.gin
[RisingBridge]
Gfx=..\..\Graphics\platforms\seesaw\seesaw_wooden.gin
[BalloonBridge]
Gfx=..\..\Graphics\platforms\seesaw\seesaw_wooden.gin

View File

@ -1217,6 +1217,14 @@ SOURCE=..\..\..\source\pickups\pspatula.h
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\..\source\platform\pbaloon.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\platform\pbaloon.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\platform\pbgeyser.cpp
# End Source File
# Begin Source File