ELEC2645 (2018/19) / Mbed 2 deprecated el17lw

Dependencies:   mbed

Revision:
28:be77ad6c0bda
Parent:
25:aa145767fda5
--- a/Fire/Fire.h	Sat May 04 13:26:50 2019 +0000
+++ b/Fire/Fire.h	Tue May 07 08:39:38 2019 +0000
@@ -7,6 +7,47 @@
 * @brief Generates a fire ball that will end the game if the skateboarder touches it 
 * @author Lewis Wooltorton
 * @date April 2019
+
+@code
+
+#include "mbed.h"
+#include "N5110.h"
+#include "Gamepad.h"
+#include "Fire.h"
+#include <cstdlib>
+#include <ctime>
+
+N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11);
+Gamepad gamepad;
+Fire _fire;
+
+int _skater_y;
+int _fire_y;
+
+int main() {
+  _fire.init();
+  _fire_y = 20;
+  while(1) {
+    
+    // Generates the x coordinate of the fire.
+    _fire.generate_fire(); // Generates X coord of fire.
+    // Y is calculated from parabolic relation to game counter.
+    
+    // Check for a collision.
+    if (_skater_x == _fire.get_fire_x() 
+      && _skater_y > _fire_y - 10 
+      && _skater_y < _fire_y + 10
+      ) {  // A range of Y coords to make collision 
+    // more frequent.
+    
+    // Print fire.
+    lcd.drawSprite(_fire.get_fire_x(),_fire_y,5,8,
+                   (int*)_fire.get_fire_sprite());
+    }
+  }                 
+} 
+
+@endcode
 */
 
 class Fire {