ELEC2645 (2018/19) / Mbed 2 deprecated fy14lkaa

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Alien Class Reference

Alien Class Reference

Alien class. More...

#include <Alien.h>

Public Member Functions

void init (int x_alien, int y_alien, int speed_alien)
 initialise an identity for the Alien
void draw (N5110 &lcd)
 drawing the alien in the lcd
void update (Direction d, float mag)
 updating the direction and the magintuide of the alien (Direction d,float mag)
void set_pos (int x, int y)
 sitting up the position the of the alien
int get_pos_y ()
 Gets the postion of the y-cooridante.
int get_pos_x ()
 Gets the postion of the x-cooridante.
void add_score ()
 adding scores of the Alien
int get_score ()
 Gets the scores of the Alien.
void read_input (Gamepad &pad)
 reading the position of the alien
bool isAlive ()
 Gets the alive Alien.
void setAlive (bool alive)
 sitting the alive Alien

Detailed Description

Alien class.

class for Alien

Version:
1.0
Author:
Laila Al Badwawi
Date:
April 2019

Definition at line 52 of file Alien.h.


Member Function Documentation

void add_score (  )

adding scores of the Alien

Parameters:
_scoresadding scores when alien fired the spaceship back.

Definition at line 66 of file Alien.cpp.

void draw ( N5110 lcd )

drawing the alien in the lcd

Parameters:
_(N5110&lcd)

the libraries which draw the alien in class Alien.

Definition at line 25 of file Alien.cpp.

int get_pos_x (  )

Gets the postion of the x-cooridante.

Returns:
the position of the x-cooridante in integer which refer to the alien

Definition at line 47 of file Alien.cpp.

int get_pos_y (  )

Gets the postion of the y-cooridante.

Returns:
the position of the y-cooridante in integer which refer to the alien

Definition at line 53 of file Alien.cpp.

int get_score (  )

Gets the scores of the Alien.

Returns:
the number of the scores of the alien in integer

Definition at line 73 of file Alien.cpp.

void init ( int  x_alien,
int  y_alien,
int  speed_alien 
)

initialise an identity for the Alien

Parameters:
x_alienthe x-cooridante of Alien in intger
y_alienthe y-cooridante of Alien in integer
speed_alienthe speed of Alien in integer

Definition at line 15 of file Alien.cpp.

bool isAlive (  )

Gets the alive Alien.

Returns:
alive alien in bool

Definition at line 80 of file Alien.cpp.

void read_input ( Gamepad pad )

reading the position of the alien

Parameters:
_(Gamepadand pad)

the libraries which reading the position of the alien in class Alien to detect the collisions between it and the other objects.

void set_pos ( int  x,
int  y 
)

sitting up the position the of the alien

Parameters:
_(x,y)set the position the of the alien in x-cooridante and y-cooridante

Definition at line 59 of file Alien.cpp.

void setAlive ( bool  alive )

sitting the alive Alien

Parameters:
aliveset the positions of the alive alien in class Alien

Definition at line 88 of file Alien.cpp.

void update ( Direction  d,
float  mag 
)

updating the direction and the magintuide of the alien (Direction d,float mag)

update the direction and the magintuide of the alien.

Definition at line 31 of file Alien.cpp.