2000-08-29 21:54:22 +02:00
|
|
|
/**********************/
|
|
|
|
/*** Main Game File ***/
|
|
|
|
/**********************/
|
|
|
|
|
|
|
|
#ifndef __GAME_GAME_H__
|
|
|
|
#define __GAME_GAME_H__
|
|
|
|
|
2000-12-07 16:56:20 +01:00
|
|
|
#include "system\gstate.h"
|
|
|
|
#include "level\level.h"
|
2000-08-29 21:54:22 +02:00
|
|
|
|
2001-01-16 21:55:44 +01:00
|
|
|
#ifndef __GAME_EVENT_H__
|
|
|
|
#include "game\event.h"
|
|
|
|
#endif
|
|
|
|
|
2000-08-29 21:54:22 +02:00
|
|
|
/*****************************************************************************/
|
2000-12-07 16:56:20 +01:00
|
|
|
class FontBank;
|
2001-04-04 02:16:26 +02:00
|
|
|
class SpriteBank;
|
2001-04-19 01:04:03 +02:00
|
|
|
class CPlayer;
|
2001-05-25 20:43:47 +02:00
|
|
|
class CLayerCollision;
|
2000-08-29 21:54:22 +02:00
|
|
|
class CGameScene : public CScene
|
|
|
|
{
|
|
|
|
public:
|
2001-01-15 16:22:33 +01:00
|
|
|
CGameScene() {;}
|
|
|
|
virtual ~CGameScene() {;}
|
2001-04-25 18:41:16 +02:00
|
|
|
enum ACTOR_TYPE
|
|
|
|
{
|
|
|
|
ACTOR_PLAYER = 0,
|
|
|
|
ACTOR_FRIEND_NPC = 1,
|
|
|
|
ACTOR_ENEMY_NPC,
|
|
|
|
ACTOR_UNKNOWN,
|
|
|
|
};
|
2000-08-29 21:54:22 +02:00
|
|
|
|
|
|
|
|
2001-04-19 01:04:03 +02:00
|
|
|
void init();
|
|
|
|
virtual void createPlayer();
|
|
|
|
virtual int canPause();
|
|
|
|
void shutdown();
|
|
|
|
void render();
|
|
|
|
void think(int _frames);
|
|
|
|
int readyToShutdown();
|
|
|
|
char *getSceneName() {return "Game";}
|
2000-08-29 21:54:22 +02:00
|
|
|
|
2001-05-13 23:06:26 +02:00
|
|
|
int getChapterNumber();
|
|
|
|
int getLevelNumber();
|
|
|
|
int getTotalSpatCountForThisLevel();
|
|
|
|
|
2001-04-19 01:04:03 +02:00
|
|
|
CPlayer *getPlayer();
|
2001-05-04 21:34:09 +02:00
|
|
|
void respawnLevel();
|
2001-04-19 01:04:03 +02:00
|
|
|
void sendEvent( GAME_EVENT evt, class CThing *sourceThing );
|
2001-02-12 18:18:17 +01:00
|
|
|
|
2001-04-25 18:41:16 +02:00
|
|
|
static void setReadyToExit() {s_readyToExit=true;}
|
|
|
|
static void levelFinished() {s_levelFinished=true;}
|
2001-05-11 01:20:45 +02:00
|
|
|
static void restartlevel() {s_restartLevel=true;}
|
2001-05-16 21:06:02 +02:00
|
|
|
CLevel &GetLevel() {return(Level);}
|
2001-05-13 23:06:26 +02:00
|
|
|
|
2001-04-25 18:41:16 +02:00
|
|
|
// static MATRIX &GetCamMtx() {return(CamMtx);}
|
|
|
|
static ACTOR_TYPE getActorType( int actorNum ) {return actorType[actorNum];}
|
|
|
|
|
2001-02-09 18:01:04 +01:00
|
|
|
protected:
|
2000-08-29 21:54:22 +02:00
|
|
|
|
2001-03-06 23:14:15 +01:00
|
|
|
void initLevel();
|
2001-04-19 01:04:03 +02:00
|
|
|
void shutdownLevel();
|
2001-03-06 23:14:15 +01:00
|
|
|
|
2001-04-17 22:57:00 +02:00
|
|
|
void AspectCorrectCamera();
|
|
|
|
|
2001-04-25 18:41:16 +02:00
|
|
|
CLevel Level;
|
|
|
|
class CPauseMenu *m_pauseMenu;
|
|
|
|
class CPlayer *m_player;
|
|
|
|
static FontBank *s_genericFont;
|
|
|
|
static MATRIX CamMtx;
|
|
|
|
|
2001-05-11 01:20:45 +02:00
|
|
|
static int s_restartLevel;
|
2001-04-25 18:41:16 +02:00
|
|
|
static int s_readyToExit;
|
|
|
|
static int s_levelFinished;
|
2001-06-11 18:16:04 +02:00
|
|
|
#ifdef __VERSION_DEBUG__
|
|
|
|
static int s_skipToNextLevel;
|
|
|
|
#endif
|
2001-02-12 18:18:17 +01:00
|
|
|
|
2001-04-25 18:41:16 +02:00
|
|
|
static ACTOR_TYPE actorType[];
|
2000-10-31 17:41:02 +01:00
|
|
|
|
2001-05-25 20:43:47 +02:00
|
|
|
// global vars
|
|
|
|
public:
|
|
|
|
static void setSpriteBank(SpriteBank *SprBank) {s_GlobalSpritebank=SprBank;}
|
|
|
|
static SpriteBank *getSpriteBank() {return(s_GlobalSpritebank);}
|
|
|
|
|
|
|
|
static void setCollision(CLayerCollision *Col) {s_GlobalCollision=Col;}
|
|
|
|
static CLayerCollision *getCollision() {return(s_GlobalCollision);}
|
|
|
|
|
|
|
|
static SpriteBank *s_GlobalSpritebank;
|
|
|
|
static CLayerCollision *s_GlobalCollision;
|
|
|
|
|
2000-08-29 21:54:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
extern CGameScene GameScene;
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
#endif
|