Project Submission (late)
Dependencies: mbed
Drawer Class Reference
#include <Drawer.h>
Public Member Functions | |
Drawer (Player *player, N5110 *screenPtr) | |
Create a Drawer object capable of printing to the lcd. | |
void | drawBranch1 (Vector2Di loc) |
Draw the first branch. | |
void | drawBranch2 (Vector2Di loc) |
Draw the second branch. | |
void | drawBranch3 (Vector2Di loc) |
Draw the third branch. | |
void | drawBranch4 (Vector2Di loc) |
Draw the fourth branch. | |
void | drawBranch5 (Vector2Di loc) |
Draw the fifth branch. | |
void | drawBranch6 (Vector2Di loc) |
Draw the fifth branch. | |
void | drawScreen () |
Draw the player's current view to the screen buffer. |
Detailed Description
Drawer Class.
A class responsible for searching the maze matrix relative to the player's location and drawing the correct graphics to the LCD accordingly. can draw cells up to a distance of 4 in front of the player (not including the cell they are currently standing in).
Version 1.0
- Date:
- May 2019
Definition at line 16 of file Drawer.h.
Constructor & Destructor Documentation
Create a Drawer object capable of printing to the lcd.
- Parameters:
-
player - pointer to a player object. Player's direction and position is needed screenPtr - pointer to the LCD object. Important for the lcd object to be shared so it's a pointer.
Definition at line 6 of file Drawer.cpp.
Member Function Documentation
void drawBranch1 | ( | Vector2Di | loc ) |
Draw the first branch.
This corresponds to the line of 3 cells in front of the player, beginning from the cell immediately to their _left_.
- Parameters:
-
location - vector representing the cell to begin branch search from
Definition at line 11 of file Drawer.cpp.
void drawBranch2 | ( | Vector2Di | loc ) |
Draw the second branch.
This corresponds to the line of 3 cells in front of the player, beginning from the cell immediately to their _right_.
- Parameters:
-
location - vector representing the cell to begin branch search from
Definition at line 41 of file Drawer.cpp.
void drawBranch3 | ( | Vector2Di | loc ) |
Draw the third branch.
This corresponds to the line of 3 cells in front of the player, beginning from the cell forward one and left one.
- Parameters:
-
location - vector representing the cell to begin branch search from
Definition at line 69 of file Drawer.cpp.
void drawBranch4 | ( | Vector2Di | loc ) |
Draw the fourth branch.
This corresponds to the line of 3 cells in front of the player, beginning from the cell forward one and right one.
- Parameters:
-
location - vector representing the cell to begin branch search from
Definition at line 93 of file Drawer.cpp.
void drawBranch5 | ( | Vector2Di | loc ) |
Draw the fifth branch.
This corresponds to the line of 3 cells in front of the player, beginning from the cell forward two and left one.
- Parameters:
-
location - vector representing the cell to begin branch search from
Definition at line 117 of file Drawer.cpp.
void drawBranch6 | ( | Vector2Di | loc ) |
Draw the fifth branch.
This corresponds to the line of 3 cells in front of the player, beginning from the cell forward two and right one.
Definition at line 134 of file Drawer.cpp.
void drawScreen | ( | ) |
Draw the player's current view to the screen buffer.
drawScreen() will walk the cells in front of the player, checking
which cells are empty or solid. When it finds an empty cell either in
front, to the left or to the right of the current cell, it will draw graphics
and/or call the drawBranch# functions accordingly.
Definition at line 152 of file Drawer.cpp.
Generated on Thu Jul 14 2022 20:06:29 by 1.7.2