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;
|
2001-06-14 23:08:42 +02:00
|
|
|
class CHealthManager;
|
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-06-21 00:57:27 +02:00
|
|
|
static void setReadyToExit();
|
2001-04-25 18:41:16 +02:00
|
|
|
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-06-12 17:41:47 +02:00
|
|
|
static void setBossHasBeenKilled() {s_bossHasBeenKilled=true;}
|
|
|
|
static int getBossHasBeenKilled() {return s_bossHasBeenKilled;}
|
|
|
|
|
2001-06-14 23:08:42 +02:00
|
|
|
static void dropHealth(DVECTOR &Pos,int Amount,int Vel);
|
2001-06-21 22:51:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
GAMESTATE_SHOWING_LIVES,
|
|
|
|
GAMESTATE_PLAYING,
|
|
|
|
}GAMESTATE;
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
TIME_TO_DISPLAY_LIVES_COUNT=3*60,
|
|
|
|
SPEED_OF_FADE=10,
|
|
|
|
};
|
|
|
|
|
|
|
|
GAMESTATE m_gamestate;
|
|
|
|
int m_showingLivesTimer;
|
|
|
|
|
|
|
|
void think_showing_lives(int _frames);
|
|
|
|
void think_playing(int _frames);
|
|
|
|
void render_showing_lives();
|
|
|
|
void render_playing();
|
|
|
|
|
|
|
|
|
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-25 18:41:16 +02:00
|
|
|
CLevel Level;
|
|
|
|
class CPauseMenu *m_pauseMenu;
|
|
|
|
class CPlayer *m_player;
|
2001-06-14 23:08:42 +02:00
|
|
|
static CHealthManager *m_HealthManager;
|
2001-04-25 18:41:16 +02:00
|
|
|
static FontBank *s_genericFont;
|
2001-06-12 23:27:53 +02:00
|
|
|
class ScalableFontBank *m_scalableFont;
|
2001-04-25 18:41:16 +02:00
|
|
|
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;
|
2001-06-12 17:41:47 +02:00
|
|
|
static int s_bossHasBeenKilled;
|
2001-05-25 20:43:47 +02:00
|
|
|
|
2001-06-12 23:27:53 +02:00
|
|
|
|
|
|
|
int m_levelHasTimer;
|
|
|
|
int m_timer;
|
|
|
|
|
2000-08-29 21:54:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
extern CGameScene GameScene;
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
#endif
|