FINAL VERSION

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Laser Class Reference

Laser Class Reference

Laser Class. More...

#include <Laser.h>

Public Member Functions

 Laser ()
 Constructor declaration.
 ~Laser ()
 Deconstructor declaration.
void init ()
 Initialises the laser off screen with a set velocity.
void draw (N5110 &lcd)
 Draws the Laser at at its current coordinates on the LCD.
void update ()
 Update the Laser's y coordinate based on its velocity.
void set_posx (int x)
 Sets the Laser's x coordinate.
void set_posy (int y)
 Sets the Laser's x coordinate.
int get_x ()
 Retrieve the Laser's current x coordinate.
int get_y ()
 Retrieve the Laser's current y coordinate.

Detailed Description

Laser Class.

Author:
James Heavey, University of Leeds Controls the Laser in the Breakout game
Date:
May 2019

Definition at line 14 of file Laser.h.


Constructor & Destructor Documentation

Laser (  )

Constructor declaration.

Definition at line 3 of file Laser.cpp.

~Laser (  )

Deconstructor declaration.

Definition at line 8 of file Laser.cpp.


Member Function Documentation

void draw ( N5110 lcd )

Draws the Laser at at its current coordinates on the LCD.

Parameters:
lcda N5110 pointer

Definition at line 21 of file Laser.cpp.

int get_x (  )

Retrieve the Laser's current x coordinate.

Returns:
variable _x as an integer

Definition at line 33 of file Laser.cpp.

int get_y (  )

Retrieve the Laser's current y coordinate.

Returns:
variable _y as an integer

Definition at line 38 of file Laser.cpp.

void init (  )

Initialises the laser off screen with a set velocity.

Definition at line 13 of file Laser.cpp.

void set_posx ( int  x )

Sets the Laser's x coordinate.

Parameters:
xset the variable _x to the new local x

Definition at line 43 of file Laser.cpp.

void set_posy ( int  y )

Sets the Laser's x coordinate.

Parameters:
yset the variable _y to the new local y

Definition at line 48 of file Laser.cpp.

void update (  )

Update the Laser's y coordinate based on its velocity.

Definition at line 28 of file Laser.cpp.