ELEC2645 (2018/19) / Mbed 2 deprecated el17mtu_

Dependencies:   mbed

Revision:
18:59befe1eaa56
Parent:
16:7b179005cd91
Child:
19:5e3ee84d9233
diff -r 18795c097efc -r 59befe1eaa56 ModeA/ModeA.cpp
--- a/ModeA/ModeA.cpp	Thu May 09 02:37:27 2019 +0000
+++ b/ModeA/ModeA.cpp	Thu May 09 03:05:48 2019 +0000
@@ -1,47 +1,40 @@
 #include "ModeA.h"
 
-ModeA::ModeA()
+ModeA::ModeA() //constructor
 {
 
 }
 
-ModeA::~ModeA()
+ModeA::~ModeA() //destructor
 {
 
 }
 
-void ModeA::screen(N5110 &lcd)
-{
-
-    lcd.clear();
-    lcd.printString("GAME",0,0);
-    lcd.printString("Back:Rules",0,2);
-
-};
-
+//initialise all values 
 void ModeA::initialise(N5110 &lcd)
 {
-    x_position = 12;
-    y_position = 18;
-    speed = 1;
-    gravity = 1;
+    x_position = 12; //x coordinate of square
+    y_position = 18; //y coordinate of square
+    speed = 1; // speed of square 
+    gravity = 1; //gravitational force 
 
-    screen_width = 70;
-    bar_width = 10;
+    screen_width = 70; // pixel at which bar begins 
+    bar_width = 10; // width of the bar
 
-    bar_speed = 2;
-    score = 0;
+    bar_speed = 2; // spped of the bar
+    score = 0; // score
 
 
     srand(time(NULL));
-    size_top = rand() % 15;
+    size_top = rand() % 15; //15 random lengths of the top bar
     srand(time(NULL));
-    size_bottom = rand() % 15;
+    size_bottom = rand() % 15; //15 random length of the bottom bar
 
 
 }
 
-void ModeA::Bird(N5110 &lcd)
+//game function 
+void ModeA::Game(N5110 &lcd)
 
 {