ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el19tb

Dependencies:   mbed

Revision:
39:8b09540724b3
Parent:
31:70521f37e004
Child:
40:8cc82e3fce06
--- a/Frog/Frog.cpp	Mon May 18 01:21:34 2020 +0000
+++ b/Frog/Frog.cpp	Mon May 18 02:05:36 2020 +0000
@@ -1,8 +1,6 @@
 #include "Frog.h"
  
-Serial pc(USBTX, USBRX);
-
-//every chicken object will accept x, y, and width (square)
+//every frog object will accept x, y, and width size of grid
 Frog::Frog(int x, int y, int width){
     this->x = x;
     this->y = y;
@@ -14,3 +12,16 @@
     down = width + y;
 }
 
+// reset back to start position
+Frog::reset()
+{
+    x = (84/2)-6/2;
+    y = 48-4;
+    width = 6;
+
+    left_side = x;
+    right_side = width + x;
+    up = y;
+    down = width + y;
+}
+