Laila Al Badwawi 200906179 SpaceInvaders I declare this my own independent work and understand the university rules on plagiarism.

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Bullet Class Reference

Bullet Class Reference

bullet Class More...

#include <Bullet.h>

Public Member Functions

 Bullet ()
 creat a defult bullet
void init (int x_bullet, int y_bullet, int speed_bullet, int fired_bullet)
 initialise an identity for the Bullet
void draw (N5110 &lcd)
 drawing the bullet in the lcd
void update (Direction d, float mag)
 updating the direction and the magintuide of the bullet (Direction d,float mag)
void set_pos (int x, int y)
 setting up the position the of the bullet
int get_pos_y ()
 Gets the postion of the y-cooridante.
int get_pos_x ()
 Gets the postion of the x-cooridante.

Detailed Description

bullet Class

Controls the bullet in the SpaceInvaders game

Author:
Laila Al Badwawi, University of Leeds
Date:
April 2019

Definition at line 39 of file Bullet.h.


Constructor & Destructor Documentation

Bullet (  )

creat a defult bullet

Definition at line 5 of file Bullet.cpp.


Member Function Documentation

void draw ( N5110 lcd )

drawing the bullet in the lcd

Parameters:
_(N5110&lcd)

the libraries which draw the bullet.

Definition at line 25 of file Bullet.cpp.

int get_pos_x (  )

Gets the postion of the x-cooridante.

Returns:
the position of the x-cooridante which refer to the bullet

Definition at line 54 of file Bullet.cpp.

int get_pos_y (  )

Gets the postion of the y-cooridante.

Returns:
the position of the y-cooridante which refer to the bullet

Definition at line 60 of file Bullet.cpp.

void init ( int  x_bullet,
int  y_bullet,
int  speed_bullet,
int  fired_bullet 
)

initialise an identity for the Bullet

Parameters:
x_bulletthe x-cooridante of bullet in intger
y_bulletthe y-cooridante of bullet in integer
speed_bulletthe speed of bullet in integer
fired_bulletthe bullet fired by the spaceship

Definition at line 16 of file Bullet.cpp.

void set_pos ( int  x,
int  y 
)

setting up the position the of the bullet

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

Definition at line 66 of file Bullet.cpp.

void update ( Direction  d,
float  mag 
)

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

update the direction and the magintuide of the bullet.

Definition at line 34 of file Bullet.cpp.