player 1

Dependencies:   4DGL-uLCD-SE PinDetect SparkfunAnalogJoystick mbed-rtos mbed SDFileSystem

Fork of 4180FinalLab by Rishi Bhargava

Wireless 2 Player Pong game

Files at this revision

API Documentation at this revision

Comitter:
jlind6
Date:
Thu Jun 19 21:45:38 2014 +0000
Parent:
0:356124c0bafc
Child:
2:6163865f5ce3
Commit message:
Added some clarifying comments plus changed constructors in ball.h

Changed in this revision

ball.h Show annotated file Show diff for this revision Revisions of this file
soundBuilder.h Show annotated file Show diff for this revision Revisions of this file
tempModule.h Show annotated file Show diff for this revision Revisions of this file
--- a/ball.h	Tue Jun 17 20:03:41 2014 +0000
+++ b/ball.h	Thu Jun 19 21:45:38 2014 +0000
@@ -5,8 +5,16 @@
 {
 public:    
     // Constructors
+    Ball ();
+    Ball (float, float, int);
+    /* For Part 3: 
+     * you need to be able to pass a pin to the 
+     * tempModule object from main, so you should
+     * add in a PinName argument.
+     */
     Ball(PinName);
     Ball(PinName, float, float, int);
+    */
     // Set Functions
     void setBaseVx(float); // This sets the lowest velocity of vx (for Thermal pong) or the constant velocity
     void setBaseVy(float); // This sets the lowest velocity of vy (for Thermal pong) or the constant velocity
@@ -23,7 +31,7 @@
     
 private:
     // Data members are suggestions, feel free to add/remove
-    TempModule *tempSensor;
+    TempModule *tempSensor; // Pointer -- it's recommended to use "new" operator to create this
     int vxSign;
     int vySign;
     float fx;
--- a/soundBuilder.h	Tue Jun 17 20:03:41 2014 +0000
+++ b/soundBuilder.h	Thu Jun 19 21:45:38 2014 +0000
@@ -3,7 +3,8 @@
 class Note
 {
 public:
-    
+    // You create your own constructors and 
+    // member functions!!
 private:
     float freq;
     float length;
--- a/tempModule.h	Tue Jun 17 20:03:41 2014 +0000
+++ b/tempModule.h	Thu Jun 19 21:45:38 2014 +0000
@@ -1,5 +1,16 @@
 #include "uLCD_4DGL.h"
 
+/* Recommendation:
+ * This class doesn't need to be declared outside the Ball class,
+ * so you can create it inside the Ball class and use it only
+ * in the Ball class.
+ *
+ * If the main function or multiple objects use a piece of hardware
+ * or a class object (like uLCD or mySpeaker), you should pass a 
+ * pointer into the object rather than creating the object (either
+ * in the stack or using new).
+ */
+
 class TempModule 
 {
 public: