ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el19tb

Dependencies:   mbed

Revision:
61:3714af9caab6
Parent:
56:2797166656e0
--- a/GraphicEngine/GraphicEngine.cpp	Wed May 27 01:21:19 2020 +0000
+++ b/GraphicEngine/GraphicEngine.cpp	Wed May 27 01:54:46 2020 +0000
@@ -2,6 +2,7 @@
 
 GraphicEngine::GraphicEngine(){}
 
+/** Draw the pointer next to the menu texts */
 void GraphicEngine::getPointerPos(int sel)
 {    
     switch(sel)
@@ -100,16 +101,13 @@
 {
     lcd.drawSprite(20, 48-4*12, 36, 43,(int *)frogger_intro);  
     lcd.printString("|  FROGGER!  |", 0,5);
-
 }
 
-
 void GraphicEngine::init()
 {
     lcd.init();
 }
 
-/* TO-DO: ADD CONTROLS FOR BACKLIGHT */
 void GraphicEngine::contrast()
 {
     lcd.setContrast(0.45);  
@@ -130,6 +128,7 @@
     lcd.backLightOn();
 }
 
+/** To save function space, call different drawing functions based on the char */
 void GraphicEngine::showObj(Object *obj, int turtles_state)
 {
     if(obj->object.c == 'G' || obj->object.c == 'M') {
@@ -159,6 +158,7 @@
     lcd.drawRect(55, 0, 35, 48, FILL_BLACK);
 }
 
+/** To increase the duration of the states, make it by a factor of 1000 */
 void GraphicEngine::displayTurtles(int x, int y, char c, int turtle_sate){
     switch(turtle_sate)
     {
@@ -180,6 +180,7 @@
     }
 }
 
+/** Based on the char values you can determine the sprite */
 void GraphicEngine::displayVehicle(int x, int y, char c)
 {
     switch(c)