ELEC2645 (2018/19) / Mbed 2 deprecated el17szs

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Bat Class Reference

Bat Class Reference

Bat Class. More...

#include <Bat.h>

Public Member Functions

 Bat ()
 Constructor.
 ~Bat ()
 Deconstructor.
void init (int width, int height)
 Initlialises the Bat class.
void draw (N5110 &lcd)
 Prints the bat to the LCD at the inititialised co-ordinates.
void reset ()
 Resets the batting variables to 0 param &lcd.
int get_hit_ball (UX &ux)
 Checks if the ball has been hit with the bat during each round.
int get_loft_ball (UX &ux)
 Checks if the hit was a lofted hit.

Detailed Description

Bat Class.

Author:
Shahid Zubin Sajid, Bat charactersitics and checks for collisions
Date:
May 2019

Definition at line 15 of file Bat.h.


Constructor & Destructor Documentation

Bat (  )

Constructor.

Definition at line 4 of file Bat.cpp.

~Bat (  )

Deconstructor.

Definition at line 9 of file Bat.cpp.


Member Function Documentation

void draw ( N5110 lcd )

Prints the bat to the LCD at the inititialised co-ordinates.

Parameters:
&lcdreference object for a N5110 class object

Definition at line 32 of file Bat.cpp.

int get_hit_ball ( UX ux )

Checks if the ball has been hit with the bat during each round.

Parameters:
@ux

takes a UserExperience object to check if Button A has been pressed

Returns:
a boolean value true if ball has been hit during the round and false if ball was missed

Definition at line 41 of file Bat.cpp.

int get_loft_ball ( UX ux )

Checks if the hit was a lofted hit.

Parameters:
@ux

takes a UserExperience object to check if Button L has been pressed

Returns:
a boolean value true if button L is pressed during the round and false if button L is not pressed

Definition at line 49 of file Bat.cpp.

void init ( int  width,
int  height 
)

Initlialises the Bat class.

Sets the Bat's position and sets the batting variables to 0

Definition at line 14 of file Bat.cpp.

void reset (  )

Resets the batting variables to 0 param &lcd.

reference pointer for the LCD

Definition at line 26 of file Bat.cpp.