Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: RosenEngine/RosenEngine.cpp
- Revision:
- 30:711d722f3cef
- Parent:
- 29:4c7b16b5b6df
- Child:
- 31:c7bd3ed16840
--- 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