This commit is contained in:
parent
cfa0d08f9e
commit
7d9f17da0f
3 changed files with 104 additions and 42 deletions
|
@ -1292,3 +1292,18 @@ CNpcEnemy::NPC_UNIT_TYPE CNpcEnemy::mapEditConvertTable[NPC_UNIT_TYPE_MAX] =
|
|||
NPC_OIL_BLOB,
|
||||
NPC_PARASITIC_WORM_SEGMENT,
|
||||
};
|
||||
|
||||
CNpcPlatform::NPC_PLATFORM_UNIT_TYPE CNpcPlatform::mapEditConvertTable[NPC_PLATFORM_TYPE_MAX] =
|
||||
{
|
||||
NPC_BUBBLE_PLATFORM,
|
||||
NPC_LINEAR_PLATFORM,
|
||||
NPC_CIRCULAR_PLATFORM,
|
||||
NPC_COLLAPSING_BUBBLE_PLATFORM,
|
||||
NPC_FISH_HOOK_PLATFORM,
|
||||
NPC_RETRACTING_PLATFORM,
|
||||
NPC_GEYSER_PLATFORM,
|
||||
NPC_BOBBING_PLATFORM,
|
||||
NPC_FALLING_PLATFORM,
|
||||
NPC_CART_PLATFORM,
|
||||
NPC_PLAYER_BUBBLE_PLATFORM,
|
||||
};
|
|
@ -276,7 +276,9 @@ void CGameScene::initLevel()
|
|||
m_player->setMapSize(Level.getMapSize());
|
||||
|
||||
// Init actors (needs moving and tidying
|
||||
int pointNum;
|
||||
int actorNum;
|
||||
int platformNum;
|
||||
|
||||
sThingActor **actorList = Level.getActorList();
|
||||
if (actorList)
|
||||
|
@ -296,7 +298,6 @@ void CGameScene::initLevel()
|
|||
enemy->init();
|
||||
enemy->setLayerCollision( Level.getCollisionLayer() );
|
||||
|
||||
int pointNum;
|
||||
u16 *PntList=(u16*)MakePtr(actorList[actorNum],sizeof(sThingActor));
|
||||
|
||||
u16 newXPos, newYPos;
|
||||
|
@ -332,6 +333,50 @@ void CGameScene::initLevel()
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
sThingPlatform **platformList = Level.getPlatformList();
|
||||
if (platformList)
|
||||
{
|
||||
for ( platformNum = 0 ; platformNum < Level.getPlatformCount() ; platformNum++ )
|
||||
{
|
||||
CNpcPlatform *platform;
|
||||
platform = new ("platform") CNpcPlatform;
|
||||
ASSERT(platform);
|
||||
platform->setTypeFromMapEdit( platformList[platformNum]->Type );
|
||||
|
||||
u16 *PntList=(u16*)MakePtr(platformList[platformNum],sizeof(sThingPlatform));
|
||||
|
||||
u16 newXPos, newYPos;
|
||||
|
||||
newXPos = (u16) *PntList;
|
||||
PntList++;
|
||||
newYPos = (u16) *PntList;
|
||||
PntList++;
|
||||
|
||||
DVECTOR startPos;
|
||||
startPos.vx = newXPos;
|
||||
startPos.vy = newYPos;
|
||||
|
||||
platform->init( startPos );
|
||||
platform->setLayerCollision( Level.getCollisionLayer() );
|
||||
|
||||
platform->addWaypoint( newXPos, newYPos );
|
||||
|
||||
if ( platformList[platformNum]->PointCount > 1 )
|
||||
{
|
||||
for ( pointNum = 1 ; pointNum < platformList[platformNum]->PointCount ; pointNum++ )
|
||||
{
|
||||
newXPos = (u16) *PntList;
|
||||
PntList++;
|
||||
newYPos = (u16) *PntList;
|
||||
PntList++;
|
||||
|
||||
platform->addWaypoint( newXPos, newYPos );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Song is loaded/dumped by the level, and played from here. This just gives some
|
||||
// better timing over when it starts (pkg)
|
||||
CSoundMediator::playSong();
|
||||
|
|
|
@ -36,6 +36,8 @@ public:
|
|||
static DVECTOR getPlayerSpawnPos() {return s_playerSpawnPos;}
|
||||
int getActorCount() {return ActorCount;}
|
||||
sThingActor **getActorList() {return ActorList;}
|
||||
int getPlatformCount() {return PlatformCount;}
|
||||
sThingPlatform **getPlatformList() {return PlatformList;}
|
||||
CLayerCollision *getCollisionLayer() {return CollisionLayer;}
|
||||
DVECTOR getMapSize();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue