ELEC2645 (2018/19) / Mbed 2 deprecated fy14lkaa

Dependencies:   mbed

Revision:
145:e060e890c725
Parent:
137:fe80c0f2da9d
Child:
146:5014ef83d4e6
--- a/SpaceEngine/SpaceEngine.cpp	Thu May 09 08:26:27 2019 +0000
+++ b/SpaceEngine/SpaceEngine.cpp	Thu May 09 09:27:32 2019 +0000
@@ -1,9 +1,9 @@
 #include"SpaceEngine.h"
 
-SpaceEngine::SpaceEngine()
+SpaceEngine::SpaceEngine() //constructor of class SpaceEngine
 {
 }
-SpaceEngine::~SpaceEngine()
+SpaceEngine::~SpaceEngine() ////Destructor of class SpaceEngine
 {
 }
 
@@ -12,8 +12,9 @@
 void SpaceEngine::init(int x_spaceship,int y_spaceship, int x_bullet, int y_bullet,int fired_bullet, int x_alien,int y_alien, int speed_alien, int speed_bullet, int speed_spaceship)
 {
 
-    _x_spaceship=x_spaceship;
-    _y_spaceship=y_spaceship;
+    _x_spaceship=x_spaceship; //represents the x-cooridante of the spaceship.
+    _y_spaceship=y_spaceship; //represents the y-cooridante of the spaceship.
+    _speed_spaceship=speed_spaceship; // speed of the spaceship.
     _x_bullet=x_bullet;
     _y_bullet=y_bullet;
     _fired_bullet= fired_bullet;
@@ -21,7 +22,7 @@
     _y_alien= y_alien;
     _speed_alien= speed_alien;
     _speed_bullet=speed_bullet;
-    _speed_spaceship=speed_spaceship;
+    
     _bullet.init(_x_bullet, _y_bullet, speed_bullet,fired_bullet);
     _alien.init (_x_alien, _y_alien,_speed_alien);
     _spaceship.init( _x_spaceship, _y_spaceship, _speed_spaceship);