ELEC2645 (2018/19) / Mbed 2 deprecated el17yfk

Dependencies:   mbed FXOS8700CQ mbed-rtos

Revision:
33:f7ec806e14b6
Parent:
26:c60becf3f840
--- a/Game_two/Insta_files/Insta.cpp	Wed May 08 15:14:55 2019 +0000
+++ b/Game_two/Insta_files/Insta.cpp	Wed May 08 23:57:04 2019 +0000
@@ -10,6 +10,7 @@
 
 }
 
+// Function to initiate the instagram icon
 void Insta::init(int speed)
 {    
     int position = rand() % 8; // randomise initial direction and position. 
@@ -58,6 +59,7 @@
     }
 }
 
+// Function to draw the instagram icon according to the updated position
 void Insta::draw(N5110 &lcd)
 {
     int Insta_data[12][12] = {
@@ -78,30 +80,35 @@
     lcd.drawSprite(_x, _y, 12, 12, (int*)Insta_data);
 }
 
+// Update the position of the instagram icon dependent on the speed
 void Insta::update()
 {
     _x += _velocity.x;
     _y += _velocity.y;
 }
 
+// Function used to set the velocity of the instagram icon
 void Insta::set_velocity(Vector2D v)
 {
     _velocity.x = v.x;
     _velocity.y = v.y;
 }
 
+// Function used to fetch the current velocity of the instagram icon
 Vector2D Insta::get_velocity()
 {
     Vector2D v = {_velocity.x,_velocity.y};
     return v;
 }
 
+// Function used to fetch the current position of the instagram icon
 Vector2D Insta::get_pos()
 {
     Vector2D p = {_x,_y};
     return p;
 }
 
+// Function used to set the current position of the instagram icon
 void Insta::set_pos(Vector2D p)
 {
     _x = p.x;