Albert Tan-Mulligan / Mbed 2 deprecated ELEC2645_Project_el18ajst

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Enemy Class Reference

Enemy Class Reference

Enemy Class: More...

#include <Enemy.h>

Public Member Functions

 Enemy (int seed)
 Constructor that sets inital x and y with random seed.
int get_x ()
 X value accessor.
int get_y ()
 Y value accessor.
void reset (int seed, N5110 &lcd)
 Mutator to reset enemy to edge with random seed, and creates an animation on death.

Detailed Description

Enemy Class:

  • Defines instances of Enemies for a 2D shooter game
Author:
Albert Tan Muligan, Student at University of Leeds
Date:
May 2020

Definition at line 14 of file Enemy.h.


Constructor & Destructor Documentation

Enemy ( int  seed )

Constructor that sets inital x and y with random seed.

Parameters:
xand y

x and y in pixels (places enemy somewhere on the edge of a 84x48 board)

Definition at line 5 of file Enemy.cpp.


Member Function Documentation

int get_x (  )

X value accessor.

Definition at line 56 of file Enemy.cpp.

int get_y (  )

Y value accessor.

Definition at line 61 of file Enemy.cpp.

void reset ( int  seed,
N5110 lcd 
)

Mutator to reset enemy to edge with random seed, and creates an animation on death.

Parameters:
seed,lcdinteger seed and pointer to lcd

Definition at line 67 of file Enemy.cpp.