ELEC2645 (2018/19) / Mbed 2 deprecated el17dg

Dependencies:   mbed

Fork of el17dg by Dmitrijs Griskovs

Revision:
27:f05f4e738ba9
Parent:
26:676874c42883
Child:
28:35af3843de8f
--- a/game/enemies.h	Sat Apr 06 20:13:33 2019 +0000
+++ b/game/enemies.h	Mon Apr 08 14:41:57 2019 +0000
@@ -16,8 +16,7 @@
   */
 class Enemy : public GameObject {
 public:
-/**@brief
-  * This function spawns an enemy on the right side of the screen at the 
+/**This function spawns an enemy on the right side of the screen at the 
   * x-direction LCD limit(84) and at random position in the y-direction.
   */
     void spawn() {
@@ -28,16 +27,17 @@
         dead_counter = 0;
         blast_countdown = 0;
     }
-/**@brief
-  * This is a death function of an nemy when the the collision between the 
+/** This is a death function of an nemy when the the collision between the 
   * player blast and enemy ship is true. It sets the enemy ship to not active.
   */
     void die() {
+        gamepad.tone(87,0.1);
+        gamepad.tone(187,0.2);
+        gamepad.tone(123,0.3);
         dead = true;
         dead_counter = 3;
     }
-/**@brief
-  * This function draws each individual enemy ship on the screen.
+/** This function draws each individual enemy ship on the screen.
   */    
     void updateAndDraw() {
         pos.x -= enemy_speed;
@@ -52,8 +52,7 @@
             active = false;
         }
     }
-/**@brief
-  * This is an explosion function that draws the enemy ships explosion sprites
+/** This is an explosion function that draws the enemy ships explosion sprites
   * when the player's shot hits it/
   */        
     void updateAndDrawDeathExplosion() {
@@ -97,8 +96,7 @@
         enemy_blast_bounds.center.y = 1;
         enemy_blast_bounds.radius = 1;
     }
-/**@brief
-  * This function spawns a new enemy when there is a free spance in the enemy aray.
+/** This function spawns a new enemy when there is a free spance in the enemy aray.
   */  
     void spawnNewEnemy() {
         int found = -1;
@@ -113,8 +111,7 @@
             enemies[found].spawn();
         }
     }
-/**@brief
-  * This function draws the enemy ships and enemy blasts whenever they are 
+/** This function draws the enemy ships and enemy blasts whenever they are 
   * avaialbe to move. Also, it limits the fire rate of the enemy ships.
   */  
     void updateAndDrawEnemies() {
@@ -133,8 +130,7 @@
             }
         }
     }
-/**@brief
-  * This function fires a blast whenever it is free in the blast array.
+/** This function fires a blast whenever it is free in the blast array.
   * If the blast is free to be shot, it will become active and will get the.
   * positions of x and y in front of the enemy ship  
   */
@@ -155,9 +151,8 @@
         }
         return false;
     }
-/**@brief
-  * Whenever the blast is active, this function draws the blast accross the    
-  *  x- direction of the screen until it reaches the left screen limit and then
+/** Whenever the blast is active, this function draws the blast accross the    
+  * x- direction of the screen until it reaches the left screen limit and then
   * becomes inactive, therefore freeing a space in the blast array. 
   */
     void updateAndDrawEnemyBlasts() {