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.
main.h
- Committer:
- Kern_EL17KJTF
- Date:
- 2019-05-07
- Revision:
- 7:ffbc921c20f7
- Parent:
- 6:478f81e79d9b
- Child:
- 8:421f94b816c4
File content as of revision 7:ffbc921c20f7:
#ifndef MAIN_H #define MAIN_H // include the different header files #include "mbed.h" #include "N5110.h" #include "Gamepad.h" // main menu ------------------------ void init(); void print_menu(); void welcome(); void arrow_location(); void arrow_select(); int menu_arrow[7][7] = { // Arrow pointer used in main menu {0,0,0,0,0,0,0,}, {0,0,0,0,1,0,0,}, {0,0,0,0,1,1,0,}, {1,1,1,1,1,1,1,}, {0,0,0,0,1,1,0,}, {0,0,0,0,1,0,0,}, {0,0,0,0,0,0,0,}, }; int menu_dk_face[36][34] = { // donkey kong face for menu { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0 }, { 0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0 }, { 0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0 }, { 0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,1,0,0,0,1,1,1,0,0,0,0,0 }, { 0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,1,1,0,0,0,0,0 }, { 0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,1,0,0,0,0,0 }, { 0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,1,1,0,0,0,0,0 }, { 0,0,0,0,0,0,0,1,1,0,0,0,0,0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,0,0,0,0 }, }; // Game Engine ---------------------- class GameEngine { public: GameEngine(); ~GameEngine(); void gameengine_run(Gamepad &pad, N5110 &lcd); }; // Donkey ----- class Donkey { public: Donkey(); ~Donkey(); void donkeykong_movement(Gamepad &pad, N5110 &lcd); }; int game_dk_walking_right_1[16][16] = { {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,}, {1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,}, {1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,}, }; int game_dk_walking_left_1[16][16] = { {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,}, {1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,}, {1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,}, }; int game_dk_stationary[16][16] = { {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,}, {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,}, }; // Barrel ----- // Banana ----- // Controls ------------------------- void controls_run(); // Instructions --------------------- void instructions_run(); // Options -------------------------- class Options { public: Options(); ~Options(); void options_run(Gamepad &pad, N5110 &lcd); void options_brightness(Gamepad &pad, N5110 &lcd); void options_contrast(Gamepad &pad, N5110 &lcd); void options_volume(Gamepad &pad, N5110 &lcd); }; // High Scores----------------------- void high_scores_run(); #endif