This commit is contained in:
parent
1953cb2f8b
commit
9565c4e575
16 changed files with 160 additions and 135 deletions
|
@ -94,8 +94,7 @@ game_src := convo \
|
|||
game \
|
||||
gamebubs \
|
||||
gameslot \
|
||||
pause \
|
||||
thing
|
||||
pause
|
||||
|
||||
gfx_src := prim \
|
||||
tpage \
|
||||
|
|
|
@ -54,6 +54,8 @@ class CLayerCollision *CNpc::m_layerCollision;
|
|||
|
||||
void CNpc::init()
|
||||
{
|
||||
CEnemyThing::init();
|
||||
|
||||
m_type = NPC_CIRCULAR_PLATFORM;
|
||||
|
||||
m_heading = m_fireHeading = 0;
|
||||
|
@ -77,6 +79,9 @@ void CNpc::init()
|
|||
|
||||
m_layerCollision = NULL;
|
||||
|
||||
//pkg
|
||||
m_npcPath.initPath();
|
||||
//pkg
|
||||
switch ( m_data[this->m_type].initFunc )
|
||||
{
|
||||
case NPC_INIT_DEFAULT:
|
||||
|
@ -277,11 +282,15 @@ void CNpc::init()
|
|||
void CNpc::shutdown()
|
||||
{
|
||||
m_npcPath.removeAllWaypoints();
|
||||
|
||||
CEnemyThing::shutdown();
|
||||
}
|
||||
|
||||
|
||||
void CNpc::think(int _frames)
|
||||
{
|
||||
CEnemyThing::think(_frames);
|
||||
|
||||
processGenericGetUserDist( _frames, &playerXDist, &playerYDist );
|
||||
playerXDistSqr = playerXDist * playerXDist;
|
||||
playerYDistSqr = playerYDist * playerYDist;
|
||||
|
@ -941,6 +950,7 @@ void CNpc::processTimer(int _frames)
|
|||
|
||||
void CNpc::render()
|
||||
{
|
||||
CEnemyThing::render();
|
||||
}
|
||||
|
||||
void CNpc::processEvent( GAME_EVENT evt, CThing *sourceThing )
|
||||
|
|
|
@ -15,7 +15,11 @@
|
|||
#define __ENEMY_NPC_H__
|
||||
|
||||
//#include <dstructs.h>
|
||||
#include "Game/Thing.h"
|
||||
|
||||
#ifndef __THING_THING_H__
|
||||
#include "thing/thing.h"
|
||||
#endif
|
||||
|
||||
#include "Gfx/Skel.h"
|
||||
|
||||
#ifndef __ENEMY_NPCPATH_H__
|
||||
|
@ -28,7 +32,7 @@
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
class CNpc : public CThing
|
||||
class CNpc : public CEnemyThing
|
||||
{
|
||||
public:
|
||||
enum NPC_UNIT_TYPE
|
||||
|
|
|
@ -33,7 +33,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
3,
|
||||
128,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_GARY
|
||||
|
@ -47,7 +47,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
3,
|
||||
2048,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_FALLING_ITEM
|
||||
|
@ -61,7 +61,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
8,
|
||||
128,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_FISH_HOOK
|
||||
|
@ -75,7 +75,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
3,
|
||||
128,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_DUST_DEVIL
|
||||
|
@ -89,7 +89,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
3,
|
||||
2048,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_PENDULUM
|
||||
|
@ -103,7 +103,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
3,
|
||||
2048,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_FIREBALL
|
||||
|
@ -117,7 +117,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
40,
|
||||
2048,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_SAW_BLADE
|
||||
|
@ -131,7 +131,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
3,
|
||||
2048,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_LINEAR_PLATFORM
|
||||
|
@ -145,7 +145,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
3,
|
||||
128,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_CIRCULAR_PLATFORM
|
||||
|
@ -159,7 +159,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
3,
|
||||
128,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_SMALL_JELLYFISH_1
|
||||
|
@ -173,7 +173,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
3,
|
||||
128,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_SMALL_JELLYFISH_2
|
||||
|
@ -187,7 +187,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
3,
|
||||
128,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_ANEMONE_1
|
||||
|
@ -201,7 +201,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
0,
|
||||
128,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_ANEMONE_2
|
||||
|
@ -215,7 +215,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
0,
|
||||
128,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_ANEMONE_3
|
||||
|
@ -229,7 +229,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
0,
|
||||
128,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_SKELETAL_FISH
|
||||
|
@ -243,7 +243,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
3,
|
||||
2048,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_CLAM
|
||||
|
@ -256,7 +256,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
0,
|
||||
128,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_SQUID_DART
|
||||
|
@ -270,7 +270,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
5,
|
||||
256,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_FISH_FOLK
|
||||
|
@ -284,7 +284,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
2,
|
||||
2048,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_PRICKLY_BUG
|
||||
|
@ -298,7 +298,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
1,
|
||||
128,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_SEA_SNAKE_1
|
||||
|
@ -312,7 +312,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
3,
|
||||
256,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_SEA_SNAKE_2
|
||||
|
@ -326,7 +326,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
3,
|
||||
256,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_PUFFA_FISH
|
||||
|
@ -340,7 +340,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
2,
|
||||
128,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_ANGLER_FISH
|
||||
|
@ -354,7 +354,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
1,
|
||||
128,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_HERMIT_CRAB
|
||||
|
@ -368,7 +368,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
2,
|
||||
128,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_MINE
|
||||
|
@ -382,7 +382,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
0,
|
||||
128,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_BOOGER_MONSTER
|
||||
|
@ -396,7 +396,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
0,
|
||||
128,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_SPIDER_CRAB
|
||||
|
@ -410,7 +410,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
3,
|
||||
2048,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_EYEBALL
|
||||
|
@ -424,7 +424,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
0,
|
||||
128,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_BABY_OCTOPUS
|
||||
|
@ -438,7 +438,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
2,
|
||||
512,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_ZOMBIE_FISH_FOLK
|
||||
|
@ -452,7 +452,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
2,
|
||||
2048,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_NINJA_STARFISH
|
||||
|
@ -466,7 +466,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
3,
|
||||
64,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_GHOST
|
||||
|
@ -480,7 +480,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
2,
|
||||
128,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_GHOST_PIRATE
|
||||
|
@ -494,7 +494,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
0,
|
||||
128,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_FLAMING_SKULL
|
||||
|
@ -508,7 +508,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
3,
|
||||
128,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_SHARK_MAN
|
||||
|
@ -522,7 +522,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
3,
|
||||
2048,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_OIL_BLOB
|
||||
|
@ -536,7 +536,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
3,
|
||||
64,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_SKULL_STOMPER
|
||||
|
@ -550,7 +550,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
5,
|
||||
2048,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_MOTHER_JELLYFISH
|
||||
|
@ -564,7 +564,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
3,
|
||||
256,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_SUB_SHARK
|
||||
|
@ -578,7 +578,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
3,
|
||||
256,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_FLYING_DUTCHMAN
|
||||
|
@ -592,7 +592,7 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
3,
|
||||
256,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
|
||||
{ // NPC_IRON_DOGFISH
|
||||
|
@ -606,6 +606,6 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
3,
|
||||
2048,
|
||||
false,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
},
|
||||
};
|
|
@ -99,18 +99,18 @@ void CGameScene::init()
|
|||
|
||||
Level.init();
|
||||
|
||||
#ifdef __USER_charles__
|
||||
//#ifdef __USER_charles__
|
||||
C2dEnemy *enemy;
|
||||
enemy=new ("test enemy") C2dEnemy;
|
||||
enemy->init();
|
||||
enemy->setLayerCollision( Level.getCollisionLayer() );
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
#ifdef __USER_paul__
|
||||
DVECTOR pos={16*10,16*10};
|
||||
createPickup(PICKUP__100_PERCENT_LIFE,&pos);
|
||||
pos.vx+=32; createPickup(PICKUP__50_PERCENT_LIFE,&pos);
|
||||
pos.vx+=32; createPickup(PICKUP__25_PERCENT_LIFE,&pos);
|
||||
createPickup(PICKUP__BIG_HEALTH,&pos);
|
||||
pos.vx+=32; createPickup(PICKUP__MEDIUM_HEALTH,&pos);
|
||||
pos.vx+=32; createPickup(PICKUP__SMALL_HEALTH,&pos);
|
||||
pos.vx+=32; createPickup(PICKUP__LIFE,&pos);
|
||||
pos.vx+=32; createPickup(PICKUP__SPATULA,&pos);
|
||||
pos.vx+=32; createPickup(PICKUP__JELLY_LAUNCHER_AMMO,&pos);
|
||||
|
|
|
@ -12,10 +12,6 @@
|
|||
#include "game\event.h"
|
||||
#endif
|
||||
|
||||
#ifndef __GAME_THING_H__
|
||||
#include "game\thing.h"
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
class FontBank;
|
||||
|
||||
|
@ -37,7 +33,7 @@ virtual int canPause();
|
|||
|
||||
static MATRIX *GetCamMtx() {return(&CamMtx);}
|
||||
class CPlayer *getPlayer();
|
||||
void sendEvent( GAME_EVENT evt, CThing *sourceThing );
|
||||
void sendEvent( GAME_EVENT evt, class CThing *sourceThing );
|
||||
|
||||
static void setReadyToExit() {s_readyToExit=true;}
|
||||
|
||||
|
|
|
@ -116,11 +116,11 @@ void CBaseHealthPickup::renderPickup(DVECTOR *_pos)
|
|||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
int C100HealthPickup::getHealthPoints()
|
||||
int CLargeHealthPickup::getHealthPoints()
|
||||
{
|
||||
return 100;
|
||||
return 5;
|
||||
}
|
||||
int C100HealthPickup::getFrameNumber()
|
||||
int CLargeHealthPickup::getFrameNumber()
|
||||
{
|
||||
return FRM__HEALTH100;
|
||||
}
|
||||
|
@ -131,11 +131,11 @@ int C100HealthPickup::getFrameNumber()
|
|||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
int C50HealthPickup::getHealthPoints()
|
||||
int CMediumHealthPickup::getHealthPoints()
|
||||
{
|
||||
return 50;
|
||||
return 3;
|
||||
}
|
||||
int C50HealthPickup::getFrameNumber()
|
||||
int CMediumHealthPickup::getFrameNumber()
|
||||
{
|
||||
return FRM__HEALTH50;
|
||||
}
|
||||
|
@ -146,11 +146,11 @@ int C50HealthPickup::getFrameNumber()
|
|||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
int C25HealthPickup::getHealthPoints()
|
||||
int CSmallHealthPickup::getHealthPoints()
|
||||
{
|
||||
return 25;
|
||||
return 1;
|
||||
}
|
||||
int C25HealthPickup::getFrameNumber()
|
||||
int CSmallHealthPickup::getFrameNumber()
|
||||
{
|
||||
return FRM__HEALTH25;
|
||||
}
|
||||
|
|
|
@ -54,21 +54,21 @@ private:
|
|||
};
|
||||
|
||||
|
||||
class C100HealthPickup : public CBaseHealthPickup
|
||||
class CLargeHealthPickup : public CBaseHealthPickup
|
||||
{
|
||||
protected:
|
||||
virtual int getHealthPoints();
|
||||
virtual int getFrameNumber();
|
||||
};
|
||||
|
||||
class C50HealthPickup : public CBaseHealthPickup
|
||||
class CMediumHealthPickup : public CBaseHealthPickup
|
||||
{
|
||||
protected:
|
||||
virtual int getHealthPoints();
|
||||
virtual int getFrameNumber();
|
||||
};
|
||||
|
||||
class C25HealthPickup : public CBaseHealthPickup
|
||||
class CSmallHealthPickup : public CBaseHealthPickup
|
||||
{
|
||||
protected:
|
||||
virtual int getHealthPoints();
|
||||
|
|
|
@ -231,13 +231,15 @@ void CBaseRespawningPickup::init()
|
|||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
int respawnFlashFrames=50;
|
||||
void CBaseRespawningPickup::think(int _frames)
|
||||
{
|
||||
if(m_respawnTime==0)
|
||||
if(m_respawnTime<=respawnFlashFrames)
|
||||
{
|
||||
CBasePickup::think(_frames);
|
||||
}
|
||||
else
|
||||
|
||||
if(m_respawnTime)
|
||||
{
|
||||
m_respawnTime-=_frames;
|
||||
if(m_respawnTime<0)
|
||||
|
@ -256,7 +258,7 @@ void CBaseRespawningPickup::think(int _frames)
|
|||
void CBaseRespawningPickup::render()
|
||||
{
|
||||
if(m_respawnTime==0||
|
||||
m_respawnTime<50&&!(m_respawnTime&3))
|
||||
m_respawnTime<respawnFlashFrames&&!(m_respawnTime&4))
|
||||
{
|
||||
CBasePickup::render();
|
||||
}
|
||||
|
@ -288,14 +290,14 @@ CBasePickup *createPickup(const PICKUP_TYPE _type,const DVECTOR *_pos)
|
|||
|
||||
switch(_type)
|
||||
{
|
||||
case PICKUP__100_PERCENT_LIFE:
|
||||
pickup=new ("100HealthPickup") C100HealthPickup();
|
||||
case PICKUP__BIG_HEALTH:
|
||||
pickup=new ("LargeHealthPickup") CLargeHealthPickup();
|
||||
break;
|
||||
case PICKUP__50_PERCENT_LIFE:
|
||||
pickup=new ("15HealthPickup") C50HealthPickup();
|
||||
case PICKUP__MEDIUM_HEALTH:
|
||||
pickup=new ("MediumHealthPickup") CMediumHealthPickup();
|
||||
break;
|
||||
case PICKUP__25_PERCENT_LIFE:
|
||||
pickup=new ("25HealthPickup") C25HealthPickup();
|
||||
case PICKUP__SMALL_HEALTH:
|
||||
pickup=new ("SmallHealthPickup") CSmallHealthPickup();
|
||||
break;
|
||||
|
||||
case PICKUP__LIFE:
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
Includes
|
||||
-------- */
|
||||
|
||||
#ifndef __GAME_TPICKUP_H__
|
||||
#include "thing/tpickup.h"
|
||||
#ifndef __THING_THING_H__
|
||||
#include "thing/thing.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -32,9 +32,9 @@
|
|||
|
||||
typedef enum
|
||||
{
|
||||
PICKUP__100_PERCENT_LIFE,
|
||||
PICKUP__50_PERCENT_LIFE,
|
||||
PICKUP__25_PERCENT_LIFE,
|
||||
PICKUP__BIG_HEALTH,
|
||||
PICKUP__MEDIUM_HEALTH,
|
||||
PICKUP__SMALL_HEALTH,
|
||||
PICKUP__LIFE,
|
||||
PICKUP__SPATULA,
|
||||
PICKUP__JELLY_LAUNCHER_AMMO,
|
||||
|
@ -95,6 +95,7 @@ public:
|
|||
|
||||
protected:
|
||||
virtual int getRespawnTime()=0;
|
||||
virtual int canCollide() {return m_respawnTime==0;}
|
||||
|
||||
private:
|
||||
int m_respawnTime;
|
||||
|
|
|
@ -171,7 +171,7 @@ int angg=900;
|
|||
---------------------------------------------------------------------- */
|
||||
void CPlayer::init()
|
||||
{
|
||||
CThing::init();
|
||||
CPlayerThing::init();
|
||||
|
||||
m_layerCollision=NULL;
|
||||
|
||||
|
@ -225,7 +225,7 @@ void CPlayer::shutdown()
|
|||
#ifdef _STATE_DEBUG_
|
||||
s_debugFont.dump();
|
||||
#endif
|
||||
CThing::shutdown();
|
||||
CPlayerThing::shutdown();
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
|
@ -242,7 +242,7 @@ void CPlayer::think(int _frames)
|
|||
{
|
||||
int i;
|
||||
|
||||
CThing::think(_frames);
|
||||
CPlayerThing::think(_frames);
|
||||
|
||||
m_skel.setAng(angg);
|
||||
|
||||
|
@ -552,7 +552,7 @@ int mouth=-1,eyes=-1;
|
|||
#endif
|
||||
void CPlayer::render()
|
||||
{
|
||||
CThing::render();
|
||||
CPlayerThing::render();
|
||||
|
||||
#ifdef _STATE_DEBUG_
|
||||
s_debugFont.print(40,40,posBuf);
|
||||
|
@ -1048,6 +1048,7 @@ void CPlayer::takeDamage(DAMAGE_TYPE _damage)
|
|||
{
|
||||
case DAMAGE__FALL:
|
||||
case DAMAGE__LAVA:
|
||||
case DAMAGE__HIT_ENEMY:
|
||||
break;
|
||||
|
||||
case DAMAGE__ELECTROCUTION:
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
Includes
|
||||
-------- */
|
||||
|
||||
#ifndef __THING_TPLAYER_H__
|
||||
#include "thing/tplayer.h"
|
||||
#ifndef __THING_THING_H__
|
||||
#include "thing/thing.h"
|
||||
#endif
|
||||
|
||||
#ifndef __GFX_SKELSPNG_H__
|
||||
|
@ -105,6 +105,7 @@ typedef enum
|
|||
DAMAGE__FALL,
|
||||
DAMAGE__ELECTROCUTION,
|
||||
DAMAGE__LAVA,
|
||||
DAMAGE__HIT_ENEMY,
|
||||
}DAMAGE_TYPE;
|
||||
|
||||
|
||||
|
|
|
@ -14,12 +14,15 @@
|
|||
#ifndef __PROJECTL_PROJECTL_H__
|
||||
#define __PROJECTL_PROJECTL_H__
|
||||
|
||||
#include "Game/Thing.h"
|
||||
#ifndef __THING_THING_H__
|
||||
#include "thing/thing.h"
|
||||
#endif
|
||||
|
||||
#include "Gfx/Skel.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
class CProjectile : public CThing
|
||||
class CProjectile : public CEnemyProjectileThing
|
||||
{
|
||||
public:
|
||||
enum PROJECTILE_MOVEMENT_TYPE
|
||||
|
|
|
@ -17,10 +17,6 @@
|
|||
|
||||
#include "thing\thing.h"
|
||||
|
||||
#ifndef __THING_TPICKUP_H__
|
||||
#include "thing\tpickup.h"
|
||||
#endif
|
||||
|
||||
|
||||
/* Std Lib
|
||||
------- */
|
||||
|
@ -118,7 +114,8 @@ void CThingManager::thinkAllThings(int _frames)
|
|||
thing2=s_thingLists[CThing::TYPE_PLAYER];
|
||||
while(thing1&&thing2)
|
||||
{
|
||||
if(thing1->checkCollisionAgainst(thing2))
|
||||
if(thing1->canCollide()&&
|
||||
thing1->checkCollisionAgainst(thing2))
|
||||
{
|
||||
thing1->collidedWith(thing2);
|
||||
}
|
||||
|
@ -180,6 +177,7 @@ void CThingManager::addToThingList(CThing *_this)
|
|||
{
|
||||
_this->m_nextThing=s_thingLists[_this->getThingType()];
|
||||
s_thingLists[_this->getThingType()]=_this;
|
||||
PAUL_DBGMSG("Added thing type %d",_this->getThingType());
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
|
@ -226,10 +224,8 @@ void CThing::init()
|
|||
// Add to thing list
|
||||
CThingManager::addToThingList(this);
|
||||
|
||||
|
||||
setCollisionSize(20,20); // Some temporary defaults.. (pkg)
|
||||
setCollisionCentreOffset(0,0);
|
||||
m_collisionCentreOffset.vx=m_collisionCentreOffset.vy=0;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
|
@ -304,7 +300,6 @@ void CThing::render()
|
|||
y2=Pos.vy+10-ofs.vy;
|
||||
DrawLine(x1,y1,x2,y2,255,0,0,0);
|
||||
DrawLine(x2,y1,x1,y2,255,0,0,0);
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -420,8 +415,6 @@ void CThing::setCollisionSize(int _w,int _h)
|
|||
---------------------------------------------------------------------- */
|
||||
void CThing::updateCollisionArea()
|
||||
{
|
||||
DVECTOR size;
|
||||
|
||||
m_collisionCentre.vx=Pos.vx+m_collisionCentreOffset.vx;
|
||||
m_collisionCentre.vy=Pos.vy+m_collisionCentreOffset.vy;
|
||||
m_collisionArea.x1=m_collisionCentre.vx-(m_collisionSize.vx/2);
|
||||
|
@ -450,29 +443,16 @@ int CThing::checkCollisionAgainst(CThing *_thisThing)
|
|||
if(abs(pos.vx-thisThingPos.vx)<radius&&
|
||||
abs(pos.vy-thisThingPos.vy)<radius)
|
||||
{
|
||||
DVECTOR pos,size;
|
||||
CRECT thisRect,thatRect;
|
||||
|
||||
thisRect=getCollisionArea();
|
||||
thatRect=_thisThing->getCollisionArea();
|
||||
|
||||
//static int val=0;
|
||||
if(((thisRect.x1>=thatRect.x1&&thisRect.x1<=thatRect.x2)||(thisRect.x2>=thatRect.x1&&thisRect.x2<=thatRect.x2))&&
|
||||
((thisRect.y1>=thatRect.y1&&thisRect.y1<=thatRect.y2)||(thisRect.y2>=thatRect.y1&&thisRect.y2<=thatRect.y2)))
|
||||
{
|
||||
//PAUL_DBGMSG("hit %d",val++);
|
||||
collided=true;
|
||||
}
|
||||
else
|
||||
{
|
||||
//PAUL_DBGMSG("close %d",val++);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//PAUL_DBGMSG("%03d %03d ( %d%d )",
|
||||
// abs(Pos.vx-thisThingPos.vx),abs(Pos.vy-thisThingPos.vy),
|
||||
// abs(Pos.vx-thisThingPos.vx)<radius,abs(Pos.vy-thisThingPos.vy)<radius);
|
||||
}
|
||||
|
||||
return collided;
|
||||
|
|
|
@ -67,10 +67,14 @@ class CThing
|
|||
public:
|
||||
typedef enum
|
||||
{
|
||||
TYPE_THING, // temp.. (pkg)
|
||||
TYPE_PICKUP,
|
||||
TYPE_PLAYER,
|
||||
TYPE_PLAYERPROJECTILE,
|
||||
TYPE_NPC,
|
||||
TYPE_ENEMY,
|
||||
TYPE_ENEMYPROJECTILE,
|
||||
TYPE_PLATFORM,
|
||||
TYPE_TRIGGER,
|
||||
|
||||
MAX_TYPE,
|
||||
}
|
||||
|
@ -79,7 +83,7 @@ public:
|
|||
CThing() {;}
|
||||
virtual ~CThing() {;}
|
||||
|
||||
virtual TYPE getThingType() {return TYPE_THING;} //=0; (pkg)
|
||||
virtual TYPE getThingType()=0;
|
||||
|
||||
|
||||
virtual void init();
|
||||
|
@ -108,8 +112,6 @@ protected:
|
|||
// Pos
|
||||
DVECTOR Pos, PosDelta;
|
||||
|
||||
// Big linked list that contains all CThings ( possibly a temp measure PKG )
|
||||
// static CThing *s_thingList;
|
||||
public:
|
||||
class CThing *m_nextThing;
|
||||
|
||||
|
@ -119,10 +121,10 @@ public:
|
|||
|
||||
// -- Collision --
|
||||
public:
|
||||
DVECTOR getCollisionSize() {return m_collisionSize;}
|
||||
virtual int canCollide() {return true;}
|
||||
virtual int checkCollisionAgainst(CThing *_thisThing);
|
||||
void updateCollisionArea();
|
||||
virtual void collidedWith(CThing *_thisThing) {;} //=0; (pkg)
|
||||
virtual void collidedWith(CThing *_thisThing) {;}
|
||||
protected:
|
||||
typedef struct
|
||||
{
|
||||
|
@ -145,6 +147,48 @@ private:
|
|||
|
||||
};
|
||||
|
||||
/* These are the individual base classes for each of the seperate thing types */
|
||||
class CPickupThing : public CThing
|
||||
{
|
||||
public:
|
||||
virtual TYPE getThingType() {return TYPE_PICKUP;}
|
||||
};
|
||||
class CPlayerThing : public CThing
|
||||
{
|
||||
public:
|
||||
virtual TYPE getThingType() {return TYPE_PLAYER;}
|
||||
};
|
||||
class CPlayerProjectileThing : public CThing
|
||||
{
|
||||
public:
|
||||
virtual TYPE getThingType() {return TYPE_PLAYERPROJECTILE;}
|
||||
};
|
||||
class CNpcThing : public CThing
|
||||
{
|
||||
public:
|
||||
virtual TYPE getThingType() {return TYPE_NPC;}
|
||||
};
|
||||
class CEnemyThing : public CThing
|
||||
{
|
||||
public:
|
||||
virtual TYPE getThingType() {return TYPE_ENEMY;}
|
||||
};
|
||||
class CEnemyProjectileThing : public CThing
|
||||
{
|
||||
public:
|
||||
virtual TYPE getThingType() {return TYPE_ENEMYPROJECTILE;}
|
||||
};
|
||||
class CPlatformThing : public CThing
|
||||
{
|
||||
public:
|
||||
virtual TYPE getThingType() {return TYPE_PLATFORM;}
|
||||
};
|
||||
class CTriggerThing : public CThing
|
||||
{
|
||||
public:
|
||||
virtual TYPE getThingType() {return TYPE_TRIGGER;}
|
||||
};
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Globals
|
||||
|
|
|
@ -367,14 +367,6 @@ SOURCE=..\..\..\source\game\pause.cpp
|
|||
|
||||
SOURCE=..\..\..\source\game\pause.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\source\game\thing.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\source\game\thing.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "gfx"
|
||||
|
||||
|
@ -1067,14 +1059,6 @@ SOURCE=..\..\..\source\thing\thing.cpp
|
|||
|
||||
SOURCE=..\..\..\source\thing\thing.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\source\thing\tpickup.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\source\thing\tplayer.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "utils"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue