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

Class for power ups. More...

#include <PowerUp.h>

Inheritance diagram for Sample::PowerUp:
ShooterLibrary::GameObject

Public Member Functions

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 Activate (const Vector2 position, Level *pLevel)
 Activates the power up. More...
 
virtual ShooterLibrary::CollisionType GetCollisionType () const
 Gets the collision type mask. More...
 
virtual std::string ToString () const
 Gets a string representation of the power up. More...
 
- Public Member Functions inherited from ShooterLibrary::GameObject
virtual void SetDeactivateCallback (OnDeactivate callback)
 Sets the callback function for when the menu item is selected. More...
 
virtual void Update (const GameTime *pGameTime)
 Updates the game object. More...
 
virtual void Draw (SpriteBatch *pSpriteBatch)=0
 Renders the game object. More...
 
virtual bool IsActive () const
 Determines if the game object is active. More...
 
virtual void Activate ()
 Activates the game object.
 
virtual void Deactivate ()
 Deactivates the game object.
 
virtual Vector2GetPosition ()
 Gets the position of the game object. More...
 
virtual Vector2GetPreviousPosition ()
 Gets the previous position of the game object. More...
 
virtual Vector2 GetHalfDimensions () const
 Gets the half dimensions of the game object. More...
 
virtual uint32_t GetIndex () const
 Gets the index of the game object. More...
 
virtual float GetCollisionRadius () const
 Gets the collision radius. More...
 
virtual void Hit (const float damage)
 Hits the object, dealing damage to it. More...
 
virtual bool HasMask (CollisionType mask) const
 Determines if the object contains part of a collision bit-mask. More...
 
virtual bool IsMask (CollisionType mask) const
 Determines if the object matches a collision bit-mask. More...
 
virtual bool IsDrawnByLevel () const
 Determines if the level should draw the game object. More...
 

Static Public Member Functions

static void SetTexture (Texture *pTexture)
 Sets the texture of the power up. More...
 
static void SetGlowTexture (Texture *pTexture)
 Sets the glow texture of the power up. More...
 
- Static Public Member Functions inherited from ShooterLibrary::GameObject
static void SetCurrentLevel (Level *pLevel)
 Sets the current game level. More...
 
static LevelGetCurrentLevel ()
 Gets the current level. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ShooterLibrary::GameObject
virtual void SetCollisionRadius (const int radius)
 Sets the collision radius for the object. More...
 
virtual void SetPosition (const float x, const float y)
 Sets the screen position of the object. More...
 
virtual void SetPosition (const Vector2 &position)
 Sets the screen position of the object. More...
 
virtual void TranslatePosition (const float x, const float y)
 Offsets the current screen position of the object. More...
 
virtual void TranslatePosition (const Vector2 &offset)
 Offsets the current screen position of the object. More...
 
virtual bool IsOnScreen () const
 Determines if the game object is on the screen. More...
 

Detailed Description

Class for power ups.

Member Function Documentation

◆ Activate()

void Sample::PowerUp::Activate ( const Vector2  position,
Level pLevel 
)
virtual

Activates the power up.

Parameters
positionThe position to place the power up.
pLevelThe level that contains the power up.

◆ Draw()

void Sample::PowerUp::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.

◆ GetCollisionType()

virtual ShooterLibrary::CollisionType Sample::PowerUp::GetCollisionType ( ) const
inlinevirtual

Gets the collision type mask.

Returns
Returns bit-mask value for the collision type.
See also
CollisionTypes
CollisionManager

Implements ShooterLibrary::GameObject.

◆ SetGlowTexture()

static void Sample::PowerUp::SetGlowTexture ( Texture *  pTexture)
inlinestatic

Sets the glow texture of the power up.

Parameters
pTextureA pointer to the texture resource.

◆ SetTexture()

static void Sample::PowerUp::SetTexture ( Texture *  pTexture)
inlinestatic

Sets the texture of the power up.

Parameters
pTextureA pointer to the texture resource.

◆ ToString()

virtual std::string Sample::PowerUp::ToString ( ) const
inlinevirtual

Gets a string representation of the power up.

Returns
Returns a string displaying the type of object.

Implements ShooterLibrary::GameObject.

◆ Update()

void Sample::PowerUp::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.

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