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

SpaceEngine Class Reference

SpaceEngine Class Reference

bullet Class More...

#include <SpaceEngine.h>

Public Member Functions

void init (int x_spaceship, int y_spaceship, int x_bullet, int y_bullet, int fired_bullet, int x_alien, int y_alien, int speed_alien, int speed_bullet, int speed_spaceship)
 initialise an identity for the spaceship,alien,bullet
void read_input (Gamepad &pad)
 reading the positions of the objects
void update (Gamepad &pad)
 updating the positions of the objects (Gamepad and pad)
void draw (N5110 &lcd)
 drawing the objects in the lcd

Detailed Description

bullet Class

SpaceEngine controlls the whole game

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

Definition at line 19 of file SpaceEngine.h.


Member Function Documentation

void draw ( N5110 lcd )

drawing the objects in the lcd

this function draw the objects on the screen by using the (N5110 &lcd) libraries if statment to check if the alien is alive so the lcd can draw it on the screen else if statment will check if the alien dead so it should disappear also it draws the spaceship

Parameters:
_(N5110&lcd)

the libraries which drawing the objects of class SpaceEngine on the screen.

Definition at line 44 of file SpaceEngine.cpp.

void init ( int  x_spaceship,
int  y_spaceship,
int  x_bullet,
int  y_bullet,
int  fired_bullet,
int  x_alien,
int  y_alien,
int  speed_alien,
int  speed_bullet,
int  speed_spaceship 
)

initialise an identity for the spaceship,alien,bullet

Parameters:
x_spaceshipthe x-cooridante of spaceship in intger
y_spaceshipthe y-cooridante of spaceship in integer
speed_spaceshipthe speed of spaceship in integer
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
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 12 of file SpaceEngine.cpp.

void read_input ( Gamepad pad )

reading the positions of the objects

Parameters:
_(Gamepadand pad)

the libraries which reading the the positions of the inputs(objects) in class SpaceEngine to detect the collisions.

Definition at line 32 of file SpaceEngine.cpp.

void update ( Gamepad pad )

updating the positions of the objects (Gamepad and pad)

the libraries which updating the the positions of the inputs(objects) in class SpaceEngine to detect the collisions.

Definition at line 66 of file SpaceEngine.cpp.