- Main Page
- Classes
- Files

- File List
- File Members

# C:/Users/Public/AGS Final Folder/BFLETCHER D4010283/Source/Game/Source/BreakoutApp.h

Go to the documentation of this file.

    00001 #ifndef _BREAKOUTAPP_H_
    00002 #define _BREAKOUTAPP_H_
    00003
    00004 #include "TSingleton.h"
    00005 #include "IEventListener.h"
    00006
    00007 #include <vector>
    00008 #include "Visualisation.h"
    00009 #include "SDL.h"
    00010
    00011 #include "IScene.h"
    00012
    00013 class BreakoutApp : public TSingleton<BreakoutApp>, public IEventListener
    00014 {
    00015         public:
    00016         BreakoutApp();
    00017         ~BreakoutApp();
    00018
    00019         void Run();
    00020
    00021         void Draw();
    00022         void Update();
    00023
    00024         void Initialise();
    00025         void Shutdown();
    00026
    00027         virtual bool HandleEvent(IEvent* pEvent);
    00028
    00029         SDL_Surface* GetScreen() { return m_pScreen; }
    00030         SpriteID GetBoxSpriteFromHealth(unsigned int health)
    00031         {
    00032                 if(health >= m_vBoxSprites.size())
    00033                         health = health % m_vBoxSprites.size();
    00034
    00035                 return m_vBoxSprites[health];
    00036         }
    00037
    00038         protected:
    00039         enum eSceneType
    00040         {
    00041                 eGameScene = 0,
    00042                 eMainMenuScene,
    00043                 ePauseScene,
    00044                 eGameOverScene,
    00045                 eSplashScreenScene,
    00046                 eErrorScene,
    00047                 eNumSceneTypes
    00048         };
    00049
    00050         void InitialiseScenes();
    00051         void ChangeScene(const eSceneType &sceneType);
    00052
    00053         bool m_bQuitGame;
    00054
    00055         int m_bgMusicID;
    00056         eSceneType m_currentScene;
    00057         IScene* m_sceneArray[eNumSceneTypes];
    00058         std::vector<SpriteID> m_vBoxSprites;
    00059
    00060         //SDL settings
    00061         SDL_Surface* m_pScreen;
    00062 };
    00063
    00064 #endif