Rex Raj / Mbed 2 deprecated el17rrrs

Dependencies:   mbed Gamepad N5110 mbed-rtos

Revision:
7:574c66ebd8b0
Parent:
6:1fcfd331c047
--- a/Enemy/Enemy.cpp	Wed May 08 10:03:24 2019 +0000
+++ b/Enemy/Enemy.cpp	Thu May 09 09:54:50 2019 +0000
@@ -36,21 +36,21 @@
 
 void Enemy::location()
 {
-    int _speed = 5;  
+    int _speed = 5;             // distance the enemy moves 
     srand(time(NULL));
     int direction = rand() % 4; // randomise initial direction. 
     
     // 4 possibilities. Get random modulo and set location accordingly
-    if (direction == 0) {
+    if (direction == 0) {         // North
         _a = _a;
         _b += _speed;
-    } else if (direction == 1) {
+    } else if (direction == 1) {  //South
         _a = _a;
         _b -= _speed;
-    } else if (direction == 2) {
+    } else if (direction == 2) {  //West
         _a -= _speed;
         _b = _b;
-    } else  {
+    } else  {                     // East
         _a += _speed;
         _b = _b;
     }
@@ -59,14 +59,14 @@
 void Enemy::enemy(N5110 &lcd)
 {
 
-    // draws the first enemy
+    // Draws the first enemy
     lcd.drawSprite(_a,_b,7,8,(int *)enemy1);
 }
 
-void Enemy::update() // moves the position of the enemy when the enemy dies
+void Enemy::update() // Moves the position of the enemy when the enemy dies
 {
 
-    _fast = 2.0;  // set at 2 so that it is not too fast
+    _fast = 2.0;  // Movement speed = 2 so that it is not too fast
 
     _b+=_speed; // moves the y-position downwards
   
@@ -74,7 +74,7 @@
 }
 void Enemy::add_health()
 {
-    // increments the value of health by 1
+    // adds health
     _health++;
 }
 int Enemy::get_health()