Space Fighter
A "shmup" game for Computer Programming C++
Loading...
Searching...
No Matches
Explosion Class Reference

Represents an explosion animation in the game. More...

#include <Explosion.h>

Public Member Functions

 Explosion ()
 
virtual ~Explosion ()
 
virtual void Update (const GameTime &gameTime)
 Update the explosion.
 
virtual void Draw (SpriteBatch &spriteBatch)
 Render the explosion.
 
virtual void SetAnimation (Animation *pAnimation)
 Sets the explosion's animation.
 
virtual void Activate (const Vector2 position, const float scale=1)
 Activates the explosion.
 
virtual bool IsActive () const
 Checks if the explosion is active.
 
virtual void SetSound (AudioSample *pSound)
 Set the sound that will be played when the explosion is activated.
 
virtual AudioSampleGetSound ()
 Get the sound that will be played when the explosion is activated.
 

Protected Member Functions

virtual void SetPosition (const Vector2 position)
 Sets the explosion's position.
 

Detailed Description

Represents an explosion animation in the game.

Definition at line 8 of file Explosion.h.

Constructor & Destructor Documentation

◆ Explosion()

Explosion::Explosion ( )
inline

Definition at line 13 of file Explosion.h.

◆ ~Explosion()

virtual Explosion::~Explosion ( )
inlinevirtual

Definition at line 14 of file Explosion.h.

Member Function Documentation

◆ Activate()

void Explosion::Activate ( const Vector2 position,
const float scale = 1 )
virtual

Activates the explosion.

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

Definition at line 19 of file Explosion.cpp.

◆ Draw()

void Explosion::Draw ( SpriteBatch & spriteBatch)
virtual

Render the explosion.

Parameters
spriteBatchA reference to the game's sprite batch, used for rendering.

Definition at line 9 of file Explosion.cpp.

◆ GetSound()

virtual AudioSample * Explosion::GetSound ( )
inlinevirtual

Get the sound that will be played when the explosion is activated.

Returns
A pointer to the audio sample.

Definition at line 42 of file Explosion.h.

◆ IsActive()

virtual bool Explosion::IsActive ( ) const
inlinevirtual

Checks if the explosion is active.

Returns
True if the explosion is active.

Definition at line 34 of file Explosion.h.

◆ SetAnimation()

virtual void Explosion::SetAnimation ( Animation * pAnimation)
inlinevirtual

Sets the explosion's animation.

Parameters
pAnimationThe animation to set.

Definition at line 25 of file Explosion.h.

◆ SetPosition()

virtual void Explosion::SetPosition ( const Vector2 position)
inlineprotectedvirtual

Sets the explosion's position.

Parameters
positionThe explosion's new position.

Definition at line 49 of file Explosion.h.

◆ SetSound()

virtual void Explosion::SetSound ( AudioSample * pSound)
inlinevirtual

Set the sound that will be played when the explosion is activated.

Parameters
pSoundA pointer to the audio sample.

Definition at line 38 of file Explosion.h.

◆ Update()

void Explosion::Update ( const GameTime & gameTime)
virtual

Update the explosion.

Parameters
gameTimeA reference to the game time object.

Definition at line 3 of file Explosion.cpp.


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