ELEC2645 (2018/19) / Mbed 2 deprecated el17aio

Dependencies:   mbed

Revision:
29:4c7b16b5b6df
Parent:
28:6319e928f0aa
Child:
30:711d722f3cef
diff -r 6319e928f0aa -r 4c7b16b5b6df RosenEngine/RosenEngine.cpp
--- a/RosenEngine/RosenEngine.cpp	Thu Apr 18 20:09:29 2019 +0000
+++ b/RosenEngine/RosenEngine.cpp	Fri Apr 19 02:40:08 2019 +0000
@@ -94,18 +94,19 @@
     // warning sound
     Vector2D hp = _health.get_hp();
     int health = hp.x;
-    if(_shipno == 0 || 1) {
+    if(_shipno == 0 || _shipno == 1) {
         if(health <= 2 ) {
-            pad.tone(1300,0.1);
-            wait(0.1);
+            pad.tone(1300,0.05);
+            wait(0.05);
         }
     }
-    if(_shipno == 2) {
+    else if(_shipno == 2) {
         if(health <= 1 ) {
-            pad.tone(1300,0.1);
-            wait(0.1);
+            pad.tone(1300,0.05);
+            wait(0.05);
         }
     }
+    printf("health = %d||shipno = %d",health,_shipno);
 }
 void RosenEngine::get_pos()
 {
@@ -255,4 +256,6 @@
     if(_shipno == 2) {
         return false;
     }
+}
+void RosenEngine::score(){
 }
\ No newline at end of file