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
Menu/Menu.cpp
- Committer:
- lewisgw
- Date:
- 2019-03-28
- Revision:
- 11:b66170249a26
- Parent:
- 10:8bf3713d9e9c
- Child:
- 12:ebaefda53dd0
File content as of revision 11:b66170249a26:
#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() {} 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(); _game_engine.process_x(_game_counter); _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); }