19 m_levelIndex = levelIndex;
31 m_pResourceManager = &resourceManager;
37 if (m_pLevel)
delete m_pLevel;
41 case 0: m_pLevel =
new Level01();
break;
55 m_pLevel->
Update(gameTime);
62 m_pLevel->
Draw(spriteBatch);
void OnGameplayScreenRemoved(Screen *pScreen)
Callback function for when the gameplay screen is removed from the screen manager.
virtual void Draw(SpriteBatch &spriteBatch)
Render the screen.
GameplayScreen(const int levelIndex=0)
Instantiate a gameplay screen object.
virtual void LoadLevel(const int levelIndex)
Load a specific level.
virtual void Update(const GameTime &gameTime)
Update the screen.
virtual void LoadContent(ResourceManager &resourceManager)
Load the content for the screen.
virtual void HandleInput(const InputState &input)
Handle input for the screen.
Contains timing values for game updates and rendering.
Loads and manages the lifespan of objects from external files.
Base class for all game screens and menus.
virtual ScreenManager * GetScreenManager()
Gets a pointer to the ScreenManager, for managing game screens.
virtual void SetTransitionInTime(double seconds)
Set the time in seconds that the screen should transition in.
virtual void Show()
Tells the screen to transition in.
virtual void SetTransitionOutTime(double seconds)
Set the time in seconds that the screen should transition out.
virtual void SetRemoveCallback(OnRemove callback)
Sets the callback function for when the screen is about to be removed by the screen manager.
virtual void AddScreen(Screen *pScreen)
Add a screen to be managed.
Enables a group of sprites to be drawn using the same settings.
void Begin(const SpriteSortMode sortMode=SpriteSortMode::Deferred, const BlendState blendState=BlendState::Alpha, ALLEGRO_TRANSFORM *pTransformation=NULL)
Begins a sprite batch operation.
void End()
Flushes the sprite batch and restores the device state to how it was before Begin was called.
The first level of the game.
virtual void Draw(SpriteBatch &spriteBatch)
Render the level, and all of the game objects within it.
virtual void LoadContent(ResourceManager &resourceManager)
Load the content for the level, including game objects and resources.
virtual void SetGameplayScreen(GameplayScreen *pGameplayScreen)
Set a reference to the gameplay screen.
virtual void Update(const GameTime &gameTime)
Update the level.
virtual void HandleInput(const InputState &input)
Handle input for the level.
The main menu screen for the game.