Henry Triff / Mbed 2 deprecated ELEC2645_Project_el18ht

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Graphics Class Reference

Graphics Class Reference

Graphics Class. More...

#include <Graphics.h>

Public Member Functions

 Graphics ()
 Constructor.
 ~Graphics ()
 Destructor.
void Change_Contrast (N5110 &LCD, Gamepad &Device)
 Changes the contrast of the LCD using the left potentiometer.
void Draw_Map (Point_2D translation, int angle, float squish, float horizon_factor, Line_2D *Track_Lines, Line_2D *Track_Dotted_Lines, Line_2D *Track_Walls, Sprite_2D *Track_Sprites, Triangle_2D *Track_Boost_Plates, Map_Data map_info, int car_type, Point_2D ghost_position, N5110 &LCD)
 Draws all graphics required for the game (excluding lap counter, time, start count down and finishing trophy)
void Draw_Laps (int laps, N5110 &LCD)
 Draws the current lap count.
void Draw_Time (bool finished, Time time, N5110 &LCD)
 Draws the race time.
void Start_Sequence (int state, N5110 &LCD)
 Draws the count down numbers before the race.
void Finish (N5110 &LCD)
 Draws the finishing trophy.
void Draw_Logo (N5110 &LCD)
 Draws the game logo on startup.

Detailed Description

Graphics Class.

Creates all game graphics.

Author:
Henry W Triff
Date:
Mar, 2020

Definition at line 96 of file Graphics.h.


Constructor & Destructor Documentation

Graphics (  )

Constructor.

Definition at line 3 of file Graphics.cpp.

~Graphics (  )

Destructor.

Definition at line 7 of file Graphics.cpp.


Member Function Documentation

void Change_Contrast ( N5110 LCD,
Gamepad Device 
)

Changes the contrast of the LCD using the left potentiometer.

Parameters:
LCDThe object for the N5110 class (object)
DeviceThe object for the gamepad class (object)

Definition at line 182 of file Graphics.cpp.

void Draw_Laps ( int  laps,
N5110 LCD 
)

Draws the current lap count.

Parameters:
lapsThe current lap count (int)
LCDThe object for the N5110 class (object)

Definition at line 218 of file Graphics.cpp.

void Draw_Logo ( N5110 LCD )

Draws the game logo on startup.

Parameters:
LCDThe object for the N5110 class (object)

Definition at line 170 of file Graphics.cpp.

void Draw_Map ( Point_2D  translation,
int  angle,
float  squish,
float  horizon_factor,
Line_2D Track_Lines,
Line_2D Track_Dotted_Lines,
Line_2D Track_Walls,
Sprite_2D *  Track_Sprites,
Triangle_2D Track_Boost_Plates,
Map_Data  map_info,
int  car_type,
Point_2D  ghost_position,
N5110 LCD 
)

Draws all graphics required for the game (excluding lap counter, time, start count down and finishing trophy)

Parameters:
translationThe translation of the map. See Mechanics class. (Point_2D)
angleThe rotation of the map. See Mechanics class. (int)
squishThe y-axis squish of the map to get the 3D effect. (float)
horizon_factorThis is the squishing on x-axis points depending on their y-position to make it look more 3D
*Track_LinesPointer for the array for track lines. (Line_2D)
*Track_Dotted_LinesPointer for the array for dotted lines. (Line_2D)
*Track_WallsPointer for the array for walls. (Line_2D)
*Track_SpritesPointer for the array for sprite positions. (Sprite_2D)
*Track_Boost_PlatesPointer for the array for boost plate positions. (Triangle_2D)
map_infoStruct containing the number of elements in each array above (Map_Data)
car_typeThe car selected. (int)
ghost_positionThe current position of the ghost. (Point_2D)
LCDThe object for the N5110 class (object)

Definition at line 24 of file Graphics.cpp.

void Draw_Time ( bool  finished,
Time  time,
N5110 LCD 
)

Draws the race time.

Parameters:
finisedThe current lap count (bool)
timeThe time elapsed from the race so far (Time)
LCDThe object for the N5110 class (object)

Definition at line 237 of file Graphics.cpp.

void Finish ( N5110 LCD )

Draws the finishing trophy.

Parameters:
LCDThe object for the N5110 class (object)

Definition at line 208 of file Graphics.cpp.

void Start_Sequence ( int  state,
N5110 LCD 
)

Draws the count down numbers before the race.

Parameters:
stateThe current count down number (int)
LCDThe object for the N5110 class (object)

Definition at line 192 of file Graphics.cpp.