00001
00002
00009
00010
#ifndef CTRL_JEU_H
00011
#define CTRL_JEU_H
00012
00013
#include "xml_niveau.h"
00014
#include "entite_joueur.h"
00015
#include "type_joueur.h"
00016
00017 #define TEMPS_ENTRE_NIVEAU 5.0f
00018
00019 #define FICHIER_SON_EXPLOSION "./data/joueur/explosion.wav"
00020 #define FIFHIER_TEXTURE_JOUEUR1 "./data/joueur/joueur1.tga"
00021 #define FIFHIER_TEXTURE_JOUEUR2 "./data/joueur/joueur2.tga"
00022 #define FIFHIER_TEXTURE_BOUCLIER "./data/joueur/bouclier.tga"
00023
00025 typedef enum
00026 {
00027
ETAT_NULL = 0,
00028
ETAT_JEU_JEU,
00029
ETAT_JEU_VICTOIRE,
00030
ETAT_JEU_DEFAITE,
00031 }
EEtatJeu;
00032
00034 typedef enum
00035 {
00036
JOUEUR_NULL = 0,
00037
JOUEUR_1,
00038
JOUEUR_2
00039 }
EJoueur;
00040
00042 class CGameManager
00043 {
00044
private:
00045
static CGameManager *m_pGameManager;
00046
00047
CTypeJoueur m_TypeJoueur[2];
00048
unsigned int m_uiTypeJoueur;
00049
00050
CEntiteJoueur *m_pJoueur1;
00051
CEntiteJoueur *m_pJoueur2;
00052
00053
CXMLNiveau m_XMLNiveaux;
00054
bool m_bNiveau;
00055
unsigned int m_uiNiveau;
00056
CTimer m_NiveauTimer;
00057
EEtatJeu m_Etat;
00058
00059
CTimer m_BonusArmeTimer;
00060
CTimer m_BonusBouclierTimer;
00061
CTimer m_EnnemiTimer;
00062
00063
void UpdateEntite ();
00064
void GererNiveau ();
00065
void InitJoueur (
unsigned int uiJoueur,
const char* szJoueur1,
const char* szJoueur2);
00066
void EnregistrerScore ();
00067
00068
CGameManager ();
00069 ~
CGameManager ();
00070
00071
public:
00073
static CGameManager*
Instance ();
00075
static void Kill ();
00077
static bool IsCreate ();
00078
00079
void Update ();
00080
bool Init (
unsigned int uiJoueur,
const char* szJoueur1,
const char* szJoueur2);
00081
void InitJoueur (
CEntiteJoueur* pJoueur);
00082
void Tirer (
EJoueur Joueur,
bool bTire);
00083
void PositionnerJoueur (
EJoueur Joueur,
CVecteur Position);
00084 };
00085
00086
#endif //CTRL_JEU_H
00087