Nemesis game, second enemy

Embed: (wiki syntax)

« Back to documentation index

Enemy2 Class Reference

Enemy2 Class Reference

Enemy2 Class. More...

#include <Enemy2.h>

Public Member Functions

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

Detailed Description

Enemy2 Class.

Used for generating the second 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 Enemy2.h.


Constructor & Destructor Documentation

Enemy2 (  )

Constructor and destructor:

Definition at line 3 of file Enemy2.cpp.


Member Function Documentation

void draw ( N5110 &  lcd )

Draw Enemy2.

Draws the second 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 Enemy2.cpp.

Vector2D get_pos (  )

Get Enemy2 Position.

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

Returns:
p - the Vector2D of the parameters

Definition at line 48 of file Enemy2.cpp.

void init ( int  speed )

Initialize Enemy2.

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

Definition at line 14 of file Enemy2.cpp.

void update (  )

Update Enemy2.

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

Definition at line 38 of file Enemy2.cpp.