Dmitrijs Griskovs / Mbed 2 deprecated el17dg

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Enemies Class Reference

Enemies Class. More...

#include <enemies.h>

Public Member Functions

 Enemies ()
 Constructor Sets values for the enemy's sprite body circle area, the blast circle area and the circle radius for collsion callculations.
void spawnNewEnemy ()
 This function spawns a new enemy on the screen.
void updateAndDrawEnemies ()
 Draws the ships and the blasts.
void updateAndDrawEnemyBlasts ()
 Uodates and draws all active blasts.

Static Public Attributes

static const int max_enemies = 4
 Maximum enemies allowed on the screen.
static const int max_enemy_blasts = max_enemies*2
 Maximum enemies' blasts allowed on the screen.

Detailed Description

Enemies Class.

The class manages all enemy ships.

Responsible for spawning new ships and holding and updating them and controlling time intervals between enemy shots.

Author:
Dmitrijs Griskovs
Date:
15/04/2019

Definition at line 121 of file enemies.h.


Constructor & Destructor Documentation

Enemies (  )

Constructor Sets values for the enemy's sprite body circle area, the blast circle area and the circle radius for collsion callculations.

Definition at line 144 of file enemies.h.


Member Function Documentation

void spawnNewEnemy (  )

This function spawns a new enemy on the screen.

It spawns a new enemy on the screen when there is a free space in the enemy aray.

Definition at line 161 of file enemies.h.

void updateAndDrawEnemies (  )

Draws the ships and the blasts.

Updates and draws all active enemy ships and decides when they should fire blasts.

Definition at line 180 of file enemies.h.

void updateAndDrawEnemyBlasts (  )

Uodates and draws all active blasts.

Definition at line 201 of file enemies.h.


Field Documentation

static const int max_enemies = 4 [static]

Maximum enemies allowed on the screen.

Definition at line 127 of file enemies.h.

static const int max_enemy_blasts = max_enemies*2 [static]

Maximum enemies' blasts allowed on the screen.

Definition at line 132 of file enemies.h.