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: Menu/Menu.cpp
- Revision:
- 11:b66170249a26
- Parent:
- 10:8bf3713d9e9c
- Child:
- 12:ebaefda53dd0
--- a/Menu/Menu.cpp Tue Mar 26 11:03:05 2019 +0000 +++ b/Menu/Menu.cpp Thu Mar 28 21:27:05 2019 +0000 @@ -1,5 +1,20 @@ #include "Menu.h" +int intro_text[12][42] = { + { 1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 }, + { 1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 }, + { 1,1,0,0,0,0,0,1,1,0,0,1,1,0,1,1,0,0,0,1,1,0,0,1,1,0,0,0,1,1,0,0,0,0,0,1,1,0,0,0,1,1 }, + { 1,1,0,0,0,0,0,1,1,0,1,1,1,0,1,1,0,0,0,1,1,0,0,1,1,0,0,0,1,1,0,0,0,0,0,1,1,0,0,0,1,1 }, + { 1,1,0,0,0,0,0,1,1,0,1,1,0,0,1,1,1,1,1,1,1,0,0,1,1,0,0,0,1,1,0,0,0,0,0,1,1,1,1,1,1,1 }, + { 1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,0,0,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1 }, + { 1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,0,0,0,1,1,0,0,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0 }, + { 0,0,0,0,0,1,1,1,1,1,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,0,0,1,1,0,0,0,0,0,1,1,1,1,0,0,0 }, + { 0,0,0,0,0,1,1,1,1,0,1,1,1,0,1,1,0,0,0,1,1,0,0,1,1,0,0,0,1,1,0,0,0,0,0,1,1,0,1,1,0,0 }, + { 0,0,0,0,0,1,1,1,1,0,0,1,1,1,1,1,0,0,0,1,1,0,0,1,1,0,0,0,1,1,0,0,0,0,0,1,1,0,1,1,0,0 }, + { 1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,0,0,0,1,1,0,0,1,1,0,0,0,1,1,1,1,1,1,1,1,1,0,1,1,1,0 }, + { 1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,0,0,1,1,0,0,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1 } +}; + Menu::Menu() {} Menu::~Menu() {} @@ -7,12 +22,15 @@ void Menu::init() { _game_engine.init(); _game_counter = 0; + _start_platform = true; } void Menu::run_game_engine(N5110 &lcd, Gamepad &gamepad) { + if(_start_platform) print_intro_text(lcd); if(_game_counter == 100) _game_counter = 0; _game_engine.check_reset(); _game_engine.read_input(gamepad); + _start_platform = _game_engine.get_start_platform(); if (_game_counter % 10 == 0) _game_engine.generate_map(); _game_engine.set_level_condition(); _game_engine.process_y(); @@ -20,4 +38,9 @@ _game_engine.process_sprite(); _game_engine.update_lcd(lcd); _game_counter++; +} + +void Menu::print_intro_text(N5110 &lcd) { + lcd.drawLine(0,17,80,17,FILL_WHITE); + lcd.drawSprite(40,4,12,42,(int *)intro_text); } \ No newline at end of file