ELEC2645 (2018/19) / Mbed 2 deprecated el17aio

Dependencies:   mbed

Revision:
23:0301effce801
Parent:
22:8cad70085883
Child:
24:ab821bfeb383
--- a/RosenEngine/RosenEngine.cpp	Sun Apr 14 10:38:54 2019 +0000
+++ b/RosenEngine/RosenEngine.cpp	Sun Apr 14 11:34:14 2019 +0000
@@ -1,6 +1,6 @@
 #include "RosenEngine.h"
+DigitalIn A(PTB9);
 
-DigitalIn A_button(PTB9);
 // Constructor
 RosenEngine::RosenEngine()
 {
@@ -41,27 +41,12 @@
     if(_shipno == 0) {
         _ship.set_dimensions(9,6);
         _ship.draw_ship(lcd);
-        _weapons.draw(lcd,_shipno);
+        _weapons.draw(lcd,pad,_shipno);
     }
     if(_shipno == 1) {
         _ship.set_dimensions(7,10);
         _ship.draw_imperion(lcd);
-
-        if((A_button) == true) {
-            pad.tone(500,0.5);
-            wait(0.5);
-            pad.tone(1000,0.3);
-            wait(0.3);
-            pad.tone(1500,0.2);
-            wait(0.2);
-            pad.tone(1700,0.15);
-            wait(0.15);
-            while((A_button) == true) {
-                _weapons.draw(lcd,_shipno);
-                pad.tone(2000,0.1);
-                wait(0.1);
-            }
-        }
+        _weapons.draw(lcd,pad,_shipno);
     }
 }
 
@@ -72,7 +57,7 @@
         _ship.update_ship(_xjoystick,_yjoystick);
         _weapons.update();
     }
-    if(_shipno == 1 && A_button == false) {
+    if(_shipno == 1 && A == false) {
         _ship.update_ship(_xjoystick,_yjoystick);
         _weapons.update();
     }
@@ -155,4 +140,12 @@
         _health.update(1);
         _enemy.reset_seeker();
     }
+}
+void RosenEngine::check_enemy_projectile_collision()
+{
+    Vector2D seeker_pos = _enemy.get_seekerpos();
+    
+    if(_shipno == 0){
+        
+    }
 }
\ No newline at end of file