ELEC2645 (2018/19) / Mbed 2 deprecated el17cd

Dependencies:   mbed

Revision:
46:824ec81ff578
Parent:
39:41dcf1604fdf
--- a/Game/Game.cpp	Tue May 07 17:37:23 2019 +0000
+++ b/Game/Game.cpp	Wed May 08 18:17:59 2019 +0000
@@ -70,7 +70,7 @@
     for (int c = 0; c< noOfCubes; c++){  
         moveCubes(&cubeArray[c]); //translate cubes depending on joystick location and score
         cubeToBeRendered(&cubeArray[c], c); //add all cube faces to array to later be rendered
-        checkDespawn(&cubeArray[c]); //check if any cubes are behind the perspective
+        checkDespawn(&cubeArray[c]); //check if any cubes are behind the perspective, then respawn them
         checkDeath(&cubeArray[c]); //check if any cubes are too close to user
     }
     renderer.drawAllFaces(faceArray, noOfCubes, input.x); //draw all faces added to the face array
@@ -210,8 +210,9 @@
 }
 
 void Game::processInput(){ //Obtain user inputs and store in input struct
+    renderer.setContrast(gamepad.read_pot()); //Set the contrast of the screen based on the pot
     input.x = gamepad.get_coord().x; //Get value of joystick x axis
-    bool y = gamepad.check_event(Gamepad::Y_PRESSED);
+    bool y = gamepad.check_event(Gamepad::Y_PRESSED); //Get Y, A, B button states
     bool a = gamepad.check_event(Gamepad::A_PRESSED);
     bool b = gamepad.check_event(Gamepad::B_PRESSED);