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.
Diff: main.h
- Revision:
- 10:28575a6eaa13
- Parent:
- 9:e6832bf222b7
--- a/main.h Tue May 07 17:40:29 2019 +0000 +++ b/main.h Tue May 07 22:49:13 2019 +0000 @@ -1,198 +0,0 @@ -#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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 }, - { 0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0 }, - }; - - -// 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 ----- - -class Barrel -{ - - public: - - Barrel(); - - ~Barrel(); - - void barrel_drop(Gamepad &pad, N5110 &lcd); -}; - -int game_barrel[4][8] = { - {0,1,1,1,1,1,1,0,}, - {1,1,1,1,1,1,1,1,}, - {1,1,1,1,1,1,1,1,}, - {0,1,1,1,1,1,1,0,}, -}; -// Banana ----- - -// Game Engine ---------------------- -Barrel barrel; - -class GameEngine -{ - - public: - - GameEngine(); - - ~GameEngine(); - - void gameengine_run(Gamepad &pad, N5110 &lcd, Barrel &barrel); -}; -// 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 \ No newline at end of file