Nemesis game, fourth enemy

Embed: (wiki syntax)

« Back to documentation index

Enemy4 Class Reference

Enemy4 Class Reference

Enemy4 Class. More...

#include <Enemy4.h>

Public Member Functions

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

Detailed Description

Enemy4 Class.

Used for generating the fourth 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 Enemy4.h.


Constructor & Destructor Documentation

Enemy4 (  )

Constructor and destructor:

Definition at line 3 of file Enemy4.cpp.


Member Function Documentation

void draw ( N5110 &  lcd )

Draw Enemy4.

Draws the fourth 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 Enemy4.cpp.

Vector2D get_pos (  )

Get Enemy4 Position.

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

Returns:
p - the Vector2D of the parameters

Definition at line 48 of file Enemy4.cpp.

void init ( int  speed )

Initialize Enemy4.

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

Definition at line 14 of file Enemy4.cpp.

void update (  )

Update Enemy4.

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

Definition at line 38 of file Enemy4.cpp.