ELEC2645 (2018/19) / Mbed 2 deprecated el17aio

Dependencies:   mbed

Revision:
30:711d722f3cef
Parent:
29:4c7b16b5b6df
Child:
31:c7bd3ed16840
diff -r 4c7b16b5b6df -r 711d722f3cef RosenEngine/RosenEngine.cpp
--- a/RosenEngine/RosenEngine.cpp	Fri Apr 19 02:40:08 2019 +0000
+++ b/RosenEngine/RosenEngine.cpp	Fri Apr 19 19:40:01 2019 +0000
@@ -18,7 +18,7 @@
     // initialise the game parameters
     _ship.init(ship_width,ship_height,ship_speed,ship_xpos,ship_ypos);
     // place seeker above the ship
-    _enemy.init(48,0);
+    _enemy.init(48,0,1);
     _menu.init(16);
     _health.init(_shipno);
 
@@ -42,6 +42,7 @@
     _health.draw_health(lcd,_shipno);
     _health.draw_shields(lcd);
     _enemy.draw_seeker(lcd);
+    _enemy.draw_shooter(lcd,1);
     if(_shipno == 0) {
         _ship.set_dimensions(9,6);
         _ship.draw_ship(lcd,_shipno);
@@ -62,6 +63,7 @@
 void RosenEngine::update(Gamepad &pad)
 {
     _enemy.update_seeker(ship_xpos, ship_ypos);
+    _enemy.update_shooter(ship_xpos, ship_ypos);
     if(_shipno == 0) {
         _ship.update_ship(_xjoystick,_yjoystick);
         _weapons.update();
@@ -127,7 +129,7 @@
 }
 void RosenEngine::title(N5110 &lcd)
 {
-    _menu.title(lcd);
+    _menu.title(lcd,_shipno);
     _menu.update(_d);
 }
 int RosenEngine::get_ycursor()
@@ -257,5 +259,6 @@
         return false;
     }
 }
-void RosenEngine::score(){
+void RosenEngine::score(int points){
+    _score = _score + points;
 }
\ No newline at end of file