home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / XenonSource.exe / xenon / includes / playgamestate.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-10  |  1.7 KB  |  90 lines

  1. //-------------------------------------------------------------
  2. //
  3. // Class:    CPlayGameState
  4. //
  5. // Author:    John M Phillips
  6. //
  7. // Started:    06/05/00
  8. //
  9. // Base:    CGameState
  10. //
  11. // Derived:    None
  12. //
  13. //-------------------------------------------------------------
  14.  
  15. #ifndef _INCLUDE_PLAYGAMESTATE_H
  16. #define _INCLUDE_PLAYGAMESTATE_H
  17.  
  18. #include "gamestate.h"
  19.  
  20. //-------------------------------------------------------------
  21.  
  22. const int PLAYER_START_OFFSET = 64;        // offset from bottom of screen
  23.  
  24. const int ENERGYBAR_WIDTH = 100;        // energy bar dimensions
  25. const int ENERGYBAR_HEIGHT = 9;
  26. const int ENERGYBAR_STEP = 5;            // marker spacing
  27.  
  28. //-------------------------------------------------------------
  29.  
  30. class CPlayGameState : public CGameState
  31. {
  32.     private:
  33.  
  34.         static CPlayGameState *m_instance;
  35.  
  36.         static gsCList<CPlayer *> m_player_list;
  37.  
  38.         void setLayerPositions(int ship_y);
  39.  
  40.         void testDebugKeys(gsKeyCode key);
  41.         void displayScores();
  42.         void displayLives();
  43.         void displayEnergyBar();
  44.         void displayBossEnergyBar();
  45.         void printDebugInfo();
  46.  
  47.         CShip *m_ship;
  48.  
  49.         gsCTimer m_game_start_timer;
  50.         gsCTimer m_game_end_timer;
  51.  
  52.         enum {
  53.             CREATEPLAYER,
  54.             PLAYERACTIVE,
  55.             PLAYERDEAD,
  56.             GAMEOVER,
  57.             GAMEWON,
  58.         } m_mode;
  59.  
  60.         static int m_active_player;
  61.         static bool m_reached_boss;
  62.         static bool m_fast_forward;
  63.         static int m_yscroll;
  64.         static bool m_paused;
  65.  
  66.     public:
  67.         CPlayGameState();
  68.         ~CPlayGameState();
  69.  
  70.         static CGameState *instance();
  71.         
  72.         bool create();
  73.         bool update();
  74.         bool destroy();
  75.  
  76.         void createPlayer();
  77.  
  78.         static CPlayer *getPlayer();
  79.         void swapPlayer();
  80.  
  81.         static bool reachedBoss();
  82.  
  83.         static int getYScroll();
  84. };
  85.  
  86. //-------------------------------------------------------------
  87.  
  88. #endif
  89.  
  90.