ELEC2645 (2018/19) / Mbed 2 deprecated el17set_

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
S_Tingle
Date:
Thu May 09 14:40:58 2019 +0000
Parent:
25:1d3bf74dddeb
Commit message:
I understand the university's rules on plagiarism. I hereby declare this my own independent work.

Changed in this revision

Coin/Coin.cpp Show annotated file Show diff for this revision Revisions of this file
Enemy/Enemy1.cpp Show annotated file Show diff for this revision Revisions of this file
Enemy/Enemy1.h Show annotated file Show diff for this revision Revisions of this file
Enemy/Enemy2.cpp Show annotated file Show diff for this revision Revisions of this file
Enemy/Enemy2.h Show annotated file Show diff for this revision Revisions of this file
Game/Game.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Coin/Coin.cpp	Thu May 09 13:43:23 2019 +0000
+++ b/Coin/Coin.cpp	Thu May 09 14:40:58 2019 +0000
@@ -27,6 +27,7 @@
   return y_coin;
 }
 
+// gets current number of coins collected //
 int Coin::get_coins()
 {
   return coin;
--- a/Enemy/Enemy1.cpp	Thu May 09 13:43:23 2019 +0000
+++ b/Enemy/Enemy1.cpp	Thu May 09 14:40:58 2019 +0000
@@ -16,6 +16,11 @@
   y_enem = y;
 }
 
+// resets incrementer to 0 //
+void Enemy1::resetIncrementer() {
+  _incrementer_enem1 = 0;
+}
+
 int Enemy1::get_x_enem()
 {
   return x_enem;
--- a/Enemy/Enemy1.h	Thu May 09 13:43:23 2019 +0000
+++ b/Enemy/Enemy1.h	Thu May 09 14:40:58 2019 +0000
@@ -51,6 +51,11 @@
   */
   void init(int x,int y);
   /** 
+  * @brief Incrementer Reset
+  * @details Resets incrementer used for enemy movement
+  */
+  void resetIncrementer();
+  /** 
   * @brief Get x
   * @details Gets the current x-coordinate
   */
--- a/Enemy/Enemy2.cpp	Thu May 09 13:43:23 2019 +0000
+++ b/Enemy/Enemy2.cpp	Thu May 09 14:40:58 2019 +0000
@@ -16,6 +16,11 @@
   y_enem = y;
 }
 
+// resets incrementer to 0 //
+void Enemy2::resetIncrementer(){
+  _incrementer_enem2 = 0;
+}
+
 int Enemy2::get_x_enem()
 {
   return x_enem;
--- a/Enemy/Enemy2.h	Thu May 09 13:43:23 2019 +0000
+++ b/Enemy/Enemy2.h	Thu May 09 14:40:58 2019 +0000
@@ -62,6 +62,11 @@
   */
   void init(int x,int y);
   /** 
+  * @brief Incrementer Reset
+  * @details Resets incrementer used for enemy movement
+  */
+  void resetIncrementer();
+  /** 
   * @brief Get x
   * @details Gets the enemy's current x-coordinate
   */
--- a/Game/Game.cpp	Thu May 09 13:43:23 2019 +0000
+++ b/Game/Game.cpp	Thu May 09 14:40:58 2019 +0000
@@ -37,6 +37,13 @@
   enemyB.init(67, 20);
   enemy2.init(67, 12);
   enemyC.init(1, 1);  
+  
+  // Reset incrementers //
+  enemyA.resetIncrementer();
+  enemy1.resetIncrementer();
+  enemyB.resetIncrementer();
+  enemy2.resetIncrementer();
+  enemyC.resetIncrementer();
 }
 
 int Game::get_health()
@@ -83,6 +90,7 @@
   enemyB.drawSpriteB(lcd);
   enemy2.drawSprite2(lcd);
   enemyC.drawSpriteC(lcd);
+
   baby.drawSprite(lcd);
 }
 
--- a/main.cpp	Thu May 09 13:43:23 2019 +0000
+++ b/main.cpp	Thu May 09 14:40:58 2019 +0000
@@ -32,8 +32,6 @@
     
   init();               // initialises all initial variables
   startScreen();        // displays start screen until start pressed
-  //game.UI(lcd, pad);
-  //render(); 
   wait(1.0f/fps);       // sets wait between next frame
 
   // game loop //
@@ -51,6 +49,7 @@
     }  
   }
 }
+
 // initialises gamepad and lcd //
 void init()
 {