Nemesis game third enemy

Embed: (wiki syntax)

« Back to documentation index

Enemy3 Class Reference

Enemy3 Class Reference

Enemy3 Class. More...

#include <Enemy3.h>

Public Member Functions

 Enemy3 ()
 Constructor and destructor:
void init (int speed)
 Initialize Enemy3.
void draw (N5110 &lcd)
 Draw Enemy3.
void update ()
 Update Enemy3.
Vector2D get_pos ()
 Get Enemy3 Position.

Detailed Description

Enemy3 Class.

Used for generating the third enemy ship in the Nemesis game. Includes drawing and updating functions. Incorporates N5110.h file by Craig A. Evans.

Revision 1.0

Author:
Musallam M. M. Bseiso
Date:
3rd May 2017

Definition at line 20 of file Enemy3.h.


Constructor & Destructor Documentation

Enemy3 (  )

Constructor and destructor:

Definition at line 3 of file Enemy3.cpp.


Member Function Documentation

void draw ( N5110 &  lcd )

Draw Enemy3.

Draws the third enemy ship onto the LCD, in accordance with the parameters initialized in the "init" method.

Parameters:
N5110- nokia LCD library
lcd- pointer to nokia LCD library

Definition at line 26 of file Enemy3.cpp.

Vector2D get_pos (  )

Get Enemy3 Position.

Obtains the position (x and y coordinates) of the third enemy ship at any given time, into a two-dimensional vector.

Returns:
p - the Vector2D of the parameters

Definition at line 48 of file Enemy3.cpp.

void init ( int  speed )

Initialize Enemy3.

Initializes third enemy ship x (random) & y (fixed) positions, as well as speed.

Definition at line 14 of file Enemy3.cpp.

void update (  )

Update Enemy3.

Updates the third enemy ship's x and y position. X and y positions are altered by adding speeds.

Definition at line 38 of file Enemy3.cpp.