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:
- 27:f99249e727fd
- Parent:
- 26:a53d41adf40b
- Child:
- 28:6319e928f0aa
--- a/RosenEngine/RosenEngine.cpp Thu Apr 18 11:40:47 2019 +0000 +++ b/RosenEngine/RosenEngine.cpp Thu Apr 18 13:57:41 2019 +0000 @@ -23,6 +23,10 @@ _health.init(_shipno); } +void RosenEngine::reset() +{ + _health.init(_shipno); +} void RosenEngine::read_input(Gamepad &pad) { @@ -35,7 +39,7 @@ void RosenEngine::draw(N5110 &lcd, Gamepad &pad) { - _health.draw_health(lcd); + _health.draw_health(lcd,_shipno); _health.draw_shields(lcd); _enemy.draw_seeker(lcd); if(_shipno == 0) { @@ -66,6 +70,10 @@ _ship.update_ship(_xjoystick,_yjoystick); _weapons.update(); } + if(_shipno == 2) { + _ship.update_ship(_xjoystick,_yjoystick); + _weapons.update(); + } // _menu.update(_d); if(enemy_ship_collision() == true){ @@ -197,7 +205,7 @@ } } if(wxcol == 1 && wycol == 1) { - _weapons.set_pos(ship_xpos,ship_ypos); + _weapons.set_pos(ship_xpos,ship_ypos); // reset missle after contact return true; } } @@ -227,4 +235,7 @@ return false; } } + if(_shipno == 2) { + return false; + } } \ No newline at end of file