Arcade Shooter
Public Member Functions | List of all members
Sample::Level Class Reference

Base class for shooter levels. More...

#include <Level.h>

Inheritance diagram for Sample::Level:
ShooterLibrary::Level Sample::Level01

Public Member Functions

 Level (GameplayScreen *pGameplayScreen)
 Instantiate the level. More...
 
virtual void LoadContent (ResourceManager *pResourceManager)
 Called when resources need to be loaded. More...
 
virtual void HandleInput (const InputState *pInput)
 Called when the game has determined that player input needs to be processed. More...
 
virtual void Update (const GameTime *pGameTime)
 Called when the game has determined that game logic needs to be processed. More...
 
virtual void Draw (SpriteBatch *pSpriteBatch)
 Called when the game determines it is time to draw a frame. More...
 
virtual void SpawnPowerUp (const Vector2 position)
 Adds a power up to the level. More...
 
virtual void SpawnExplosion (const Vector2 position, const float scale=1)
 Adds an explosion to the level. More...
 
virtual void BeginCompletionCountdown ()
 Begins the count down to the end of the mission. More...
 
virtual void Complete ()
 Should be called when the victory conditions are met for the level.
 
virtual ParticleManagerGetParticleManager () const
 Gets a pointer to the ParticleManager, for managing particle effects. More...
 
virtual ScreenManagerGetScreenManager () const
 Gets a pointer to the ScreenManager, for managing game screens. More...
 
virtual void AddPlayerShip (PlayerShip *pPlayerShip)
 Adds a player ship to the level's game objects. More...
 
virtual uint8_t GetPlayerCount ()
 Gets the current number of player ships playing the level. More...
 
- Public Member Functions inherited from ShooterLibrary::Level
virtual void UnloadContent ()
 Called when resources need to be unloaded. Override this method to unload any game-specific resources.
 
virtual void AddGameObject (GameObject *pGameObject)
 Adds a game object so it can be managed by the level. More...
 
virtual void UpdateSectorPosition (GameObject *pGameObject)
 Updates an object's position on the sector grid. More...
 
template<typename T >
T * GetClosestObject (const Vector2 position, const float range)
 Get the closest active game object of a specific type. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ShooterLibrary::Level
virtual void InitializeCollisionManager ()
 Initailizes the level's default CollisionManager.
 
virtual CollisionManagerGetCollisionManager ()
 Gets the CollisionManager for testing collisions between game objects. More...
 
virtual void AddProjectilePool (ProjectilePool *pProjectilePool)
 Adds a pool of projectiles to the level. More...
 
virtual void SetBackground (Background *pBackground)
 Sets the background object for the level. More...
 

Detailed Description

Base class for shooter levels.

Constructor & Destructor Documentation

◆ Level()

Sample::Level::Level ( GameplayScreen pGameplayScreen)

Instantiate the level.

Parameters
pGameplayScreenThe gameplay screen that is controlling the level.

Member Function Documentation

◆ AddPlayerShip()

void Sample::Level::AddPlayerShip ( PlayerShip pPlayerShip)
virtual

Adds a player ship to the level's game objects.

Parameters
pPlayerShipThe player ship to add.
Remarks
If using this method to add a player ship, the ship should not be passed to AddGameObject(), because it's called internally.
See also
AddGameObject()

◆ BeginCompletionCountdown()

virtual void Sample::Level::BeginCompletionCountdown ( )
inlinevirtual

Begins the count down to the end of the mission.

Remarks
This usually means that the final enemay has been destroyed.

◆ Draw()

virtual void Sample::Level::Draw ( SpriteBatch *  pSpriteBatch)
virtual

Called when the game determines it is time to draw a frame.

Parameters
pSpriteBatchThe game's sprite batch, used for rendering.

Reimplemented from ShooterLibrary::Level.

◆ GetParticleManager()

ParticleManager * Sample::Level::GetParticleManager ( ) const
virtual

Gets a pointer to the ParticleManager, for managing particle effects.

Returns
A pointer to the game's ParticleManager instance.

Implements ShooterLibrary::Level.

◆ GetPlayerCount()

virtual uint8_t Sample::Level::GetPlayerCount ( )
inlinevirtual

Gets the current number of player ships playing the level.

Returns
Returns The count of player ships in the level.

◆ GetScreenManager()

ScreenManager * Sample::Level::GetScreenManager ( ) const
virtual

Gets a pointer to the ScreenManager, for managing game screens.

Returns
A pointer to the game's ScreenManager instance.

◆ HandleInput()

void Sample::Level::HandleInput ( const InputState pInput)
virtual

Called when the game has determined that player input needs to be processed.

Parameters
pInputThe current state of all player input devices.

◆ LoadContent()

virtual void Sample::Level::LoadContent ( ResourceManager *  pResourceManager)
virtual

Called when resources need to be loaded.

Parameters
pResourceManagerThe game's resource manager, used for loading and managing game resources.

Reimplemented from ShooterLibrary::Level.

Reimplemented in Sample::Level01.

◆ SpawnExplosion()

void Sample::Level::SpawnExplosion ( const Vector2  position,
const float  scale = 1 
)
virtual

Adds an explosion to the level.

Parameters
positionThe position to place the explosion.
scaleThe scale of the explosion.

◆ SpawnPowerUp()

void Sample::Level::SpawnPowerUp ( const Vector2  position)
virtual

Adds a power up to the level.

Parameters
positionThe position to place the power up.

◆ Update()

virtual void Sample::Level::Update ( const GameTime *  pGameTime)
virtual

Called when the game has determined that game logic needs to be processed.

Parameters
pGameTimeTiming values including time since last update.

Reimplemented from ShooterLibrary::Level.


The documentation for this class was generated from the following files: