Kostadin Chakarov / Mbed 2 deprecated el17kec

Dependencies:   mbed

Revision:
8:9b77eea95088
Parent:
7:cd3cafda3dd4
Child:
9:f720f5d87420
--- a/GameObject/GameObject.h	Wed Apr 10 09:18:25 2019 +0000
+++ b/GameObject/GameObject.h	Wed May 08 13:49:01 2019 +0000
@@ -14,29 +14,49 @@
 class StaticGameObject
 {
 public:
+    /** Constructor */
     StaticGameObject();
+    /** Destructor */
     ~StaticGameObject();
-    
+    /** Controls the movement physics of static game objects */
     virtual void move();
+    /** Draws the game objects */
     virtual void draw(N5110 &lcd);
-    const Vector2D& getPos();
+    /** Gets the x and y coordinates of game objects */
+    const Vector2D& getPos() const;
+    /** Gets the width of the game objects 
+    * @return the width of the game objects
+    */
     int getW() { return w; };
+    /** Gets the height of the game objects 
+    * @return the height of the game objects
+    */
     int getH() { return h; };
-    
+    /** Sets the width of any game object
+    * @param value - sets the width of the game objects equal to it
+    * @details Used for the power-up features
+    */
+    void setW(int value) { w = value;}
 protected:
-    int w, h;
-    Vector2D pos;
+    int w, h; /** width and height of any game object */
+    Vector2D pos; /** x and y position of any game objects */
 };
 
 
 class GameObject : public StaticGameObject
 {
 public:
+    /** Constructor */
+    GameObject() : StaticGameObject() {}
+    /** Controls the movement physics of non-static game objects */
     virtual void move();
+    /** Gets the velocity of the game objects 
+    * @return the velocity of the game objects
+    */
     Vector2D& getVelocity() { return velocity; }
     
 protected:
-    Vector2D velocity;
+    Vector2D velocity; /** velocity of non-static game objects */
     
 };
 #endif
\ No newline at end of file