ELEC2645 (2018/19) / Mbed 2 deprecated fy14lkaa

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
fy14lkaa
Date:
Thu May 09 05:50:57 2019 +0000
Parent:
138:66befaefb27e
Child:
140:e389918735a7
Commit message:
adding printf statement.

Changed in this revision

Alien/Alien.cpp Show annotated file Show diff for this revision Revisions of this file
Spaceship/Spaceship.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Alien/Alien.cpp	Thu May 09 05:42:22 2019 +0000
+++ b/Alien/Alien.cpp	Thu May 09 05:50:57 2019 +0000
@@ -11,10 +11,10 @@
 
 }
 
-//intialise the prameters of class Alien 
+
 void Alien::init(int x_alien,int y_alien, int speed_alien)
 {
-
+   //intialise the prameters of class Alien 
     _x_alien = x_alien; // the position of alien at x-cooridante.
     _y_alien = y_alien; //  the position of alien at y-cooridante.
     _speed_alien = speed_alien; // the speed of the alien. 
--- a/Spaceship/Spaceship.cpp	Thu May 09 05:42:22 2019 +0000
+++ b/Spaceship/Spaceship.cpp	Thu May 09 05:50:57 2019 +0000
@@ -1,23 +1,26 @@
 #include "Spaceship.h"
 
-Spaceship::Spaceship()
+Spaceship::Spaceship() //constructor of class Spaceship
 {
 }
-Spaceship::~Spaceship()
+Spaceship::~Spaceship() //Destructor of class Spaceship
 {
 }
 
 void Spaceship::init(int x_spaceship,int y_spaceship, int speed_spaceship)
 {
+    //intialise the prameters of class Spaceship 
 
-     _x_spaceship=  x_spaceship;
-     _y_spaceship=  y_spaceship;
-      _speed_spaceship= speed_spaceship;
+     _x_spaceship=  x_spaceship;                      // the position of spaceship at x-cooridante.
+     _y_spaceship=  y_spaceship;                      //  the position of spaceship at y-cooridante.
+      _speed_spaceship= speed_spaceship;              // the speed of the alien. 
 }
 
+
+  // void function to draw the spaceship by using N5110 library 
 void Spaceship::draw(N5110 &lcd)
 {
-
+    .  //drawing the spaceship by using lcd.drawSprite.
     lcd.drawSprite(_x_spaceship,_y_spaceship,32,32,(int *) spaceship2);
 
 }
@@ -28,8 +31,10 @@
     _speed_spaceship = int(mag*10.0f);
 
         if(d==N){
-   //  printf("North\n");
+   
             _y_spaceship-=2;
+            
+            //  printf("North\n");
             }
         else
         if(d==S){