Kern Fowler / Mbed 2 deprecated Donkey_Kong_Game

Dependencies:   mbed

main.h

Committer:
Kern_EL17KJTF
Date:
2019-05-05
Revision:
5:5667c4ec3d7e
Parent:
4:59175720d8ee
Child:
6:478f81e79d9b

File content as of revision 5:5667c4ec3d7e:

#ifndef MAIN_H
#define MAIN_H

// include the different header files
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"

N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11);
Gamepad pad; 

// function prototypes
void init();
void print_menu();
void welcome();
void arrow_location();
void arrow_select();
//-----------------------
void game_engine_run();
void donkeykong_x_movement();
//-----------------------
void controls_run();
//-----------------------
void instructions_run();
//-----------------------
void options_run();
void options_brightness();
void options_contrast();
void options_volume();
//-----------------------
void high_scores_run();

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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,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,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,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0 },
    };


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,},
};
#endif