ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el19zf

Dependencies:   mbed

Revision:
13:eb60628db8bf
Parent:
11:494cc44777fe
Child:
16:cf2bfada3adf
--- a/PeopleEngine/People.h	Mon May 11 14:43:16 2020 +0000
+++ b/PeopleEngine/People.h	Thu May 14 16:45:20 2020 +0000
@@ -6,30 +6,47 @@
 #include "N5110.h"
 
 /** People class
-    @set a basic element of my project
-    @author Zeyu Feng
-    @9 April 2020
-   */
+@set a basic element of my project
+@author Zeyu Feng
+@9 April 2020
+*/
 
 class People {
 
 public:
-    People(); //Constructor
-        
-    ~People(); //Destructor
-        
+    /**Constructor*/
+    People();
+    
+    /**Destructor*/    
+    ~People(); 
+    
+    /**initialize the position of people*/
     void init();
-        
-    void draw(N5110 &lcd);
+    
+    /**draw it on lcd and alternating type of people when running
+    *@param lcd
+    *@param type flag of people
+    */
+    void draw(N5110 &lcd,int flag);
     
+    /**update the position of people*/
     void update();
+    /** limit the people without going off screen*/
+    void control_lim();
         
-    //accessors   
+    /**accessors   set the position of people only for test
+    *@param pos(Vector2D)
+    */
     void set_pos(Vector2D p);
+    /**accessors   control the people by Joystick
+    *@param Direction (Direction)
+    *@param Mag(float)
+    */  
+    void set_velocity(Direction d,float mag);//control by gamepad
         
-    void set_velocity(Direction d,float mag);
-        
-    //mutators
+    /**mutators get the position of people only for test
+    *@return pos(Vector2D)
+    */
     Vector2D get_pos();
        
 private:
@@ -37,6 +54,7 @@
     float _mag;
     int _x;
     int _y;
+    int _index;//choose the type of people
 };
 #endif
         
\ No newline at end of file