Musallam Bseiso / Enemy5
Embed: (wiki syntax)

« Back to documentation index

Enemy5 Class Reference

Enemy5 Class Reference

Enemy5 Class. More...

#include <Enemy5.h>

Public Member Functions

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

Detailed Description

Enemy5 Class.

Used for generating the fifth 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 Enemy5.h.


Constructor & Destructor Documentation

Enemy5 (  )

Constructor and destructor:

Definition at line 3 of file Enemy5.cpp.


Member Function Documentation

void draw ( N5110 &  lcd )

Draw Enemy5.

Draws the fifth 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 Enemy5.cpp.

Vector2D get_pos (  )

Get Enemy5 Position.

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

Returns:
p - the Vector2D of the parameters

Definition at line 48 of file Enemy5.cpp.

void init ( int  speed )

Initialize Enemy5.

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

Definition at line 14 of file Enemy5.cpp.

void update (  )

Update Enemy5.

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

Definition at line 38 of file Enemy5.cpp.