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:
- 13:e114d362186d
- Parent:
- 12:47578eb9ea73
- Child:
- 14:88ca5b1a111a
--- a/RosenEngine/RosenEngine.cpp Wed Apr 10 11:01:19 2019 +0000 +++ b/RosenEngine/RosenEngine.cpp Wed Apr 10 12:04:07 2019 +0000 @@ -18,8 +18,7 @@ // initialise the game parameters _ship.init(ship_width,ship_height,ship_speed,ship_xpos,ship_ypos); _menu.init(16); - - + } void RosenEngine::read_input(Gamepad &pad) @@ -33,12 +32,16 @@ void RosenEngine::draw(N5110 &lcd) { - _ship.draw_ship(lcd); - _weapons.draw(lcd); -} -void RosenEngine::draw_Imperion(N5110 &lcd) -{ - _ship.draw_imperion(lcd); + if(_xcursor == 0){ + _ship.set_ship(9,6); + _ship.draw_ship(lcd); + _weapons.draw(lcd); + } + if(_xcursor == 1){ + _ship.set_ship(7,10); + _ship.draw_imperion(lcd); + _weapons.draw(lcd); + } } void RosenEngine::update(Gamepad &pad) @@ -55,18 +58,23 @@ ship_ypos = ship_pos.y; ship_width = 9; _weapons.init(ship_xpos, ship_ypos, ship_width); - _ycursor = _menu.get_cursor(); + _ycursor = _menu.get_ycursor(); } void RosenEngine::title(N5110 &lcd) { _menu.title(lcd); _menu.update(_d); } -int RosenEngine::get_cursor() +int RosenEngine::get_ycursor() { - _ycursor = _menu.get_cursor(); + _ycursor = _menu.get_ycursor(); return _ycursor; } +int RosenEngine::get_xcursor() +{ + _xcursor = _menu.get_xcursor(); + return _xcursor; +} void RosenEngine::ship_select(N5110 &lcd) { _menu.update(_d);