ELEC2645 (2017/18) / Mbed 2 deprecated el17yw

Dependencies:   mbed

Revision:
27:eab2cf10554e
Parent:
19:362ad1cd6d4a
Child:
28:85ddd500a116
--- a/rec/rect.cpp	Mon Apr 30 19:12:41 2018 +0000
+++ b/rec/rect.cpp	Mon Apr 30 20:29:26 2018 +0000
@@ -29,7 +29,7 @@
     
     //control the movement of rect when joystick moves
     //movement of north and south are not allowed
-      if (d == W) {
+    if (d == W) {
         rect_x-=rect_speed;
     } else if (d == E) {
         rect_x+=rect_speed;
@@ -37,6 +37,10 @@
     }
 }
 
+void rect::init_score()
+{
+    rect_score=0;
+}
 void rect::add_score()
 {
     rect_score++;