Ben Evans / Mbed 2 deprecated Defender_Game

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Explosion Class Reference

Explosion Class Reference

Explosion class. More...

#include <Explosion.h>

Inherits Position.

Public Member Functions

 Explosion ()
 Constructor.
 ~Explosion ()
 Destructor.
void init (Vector2D destroyed_position)
 Initialises explosion.
void draw_explosion (N5110 &lcd)
 Draws the explosion.
int get_explosion_radius ()
 Gets the explosion radius.
Vector2D get_pos ()
 Gets the xy position of the sprite.

Protected Attributes

int position_x_
 X position on lcd.
int position_y_
 Y position on lcd.
bool direction_
 Movement direction.

Detailed Description

Explosion class.

Draws explosion animation

Author:
Benjamin Evans, University of Leeds
Date:
May 2020

Definition at line 24 of file Explosion.h.


Constructor & Destructor Documentation

Explosion (  )

Constructor.

Definition at line 9 of file Explosion.cpp.

~Explosion (  )

Destructor.

Definition at line 13 of file Explosion.cpp.


Member Function Documentation

void draw_explosion ( N5110 lcd )

Draws the explosion.

Parameters:
lcdN5110 object

Definition at line 26 of file Explosion.cpp.

int get_explosion_radius (  )

Gets the explosion radius.

Returns:
explosion_radius_

Definition at line 47 of file Explosion.cpp.

Vector2D get_pos (  ) [inherited]

Gets the xy position of the sprite.

Returns:
position_x_
position_x_

Definition at line 3 of file Position.cpp.

void init ( Vector2D  destroyed_position )

Initialises explosion.

Parameters:
destroyed_positionVector2D of destroyed xy pos

Definition at line 17 of file Explosion.cpp.


Field Documentation

bool direction_ [protected, inherited]

Movement direction.

Note:
true = East, false = West

Definition at line 35 of file Position.h.

int position_x_ [protected, inherited]

X position on lcd.

Definition at line 27 of file Position.h.

int position_y_ [protected, inherited]

Y position on lcd.

Definition at line 30 of file Position.h.