#include <stdint.h> /* Declarations of uint_32 and the like */ #include <pic32mx.h> /* Declarations of system-specific addresses etc */ #include <stdio.h> /* Declarations of rand and the like */ #include "flappybird.h" int menuChoice = 0; // this varuabel determines which choice been taken means the button that been pressed int currentmenu = 0; int highscores[6]={0}; char highscoreschar[9]={0}; // The diffrent positions represents: 0. top score, 1. middle score, 2. lowest stored score // 3. contains initials for score 1, 4. contains initials for score 2, 5. contain initials for score 3 int difficulty = 1; // This variabel represent current game difficulty, changable in the menu int birdx = 5; int birdy = 50; //These represent current bird x and y values int birdelex1=0; int birdelex2=0; int score = 0; //This represents score of current/last game char textbuffer[4][16]; uint8_t game[512]; char TextString[10];//String for score const uint8_t const font[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, 0, 0, 0, 0, 0, 0, 4, 3, 4, 3, 0, 0, 0, 36, 126, 36, 36, 126, 36, 0, 0, 36, 74, 255, 82, 36, 0, 0, 0, 70, 38, 16, 8, 100, 98, 0, 0, 52, 74, 74, 52, 32, 80, 0, 0, 0, 0, 4, 3, 0, 0, 0, 0, 0, 0, 126, 129, 0, 0, 0, 0, 0, 0, 129, 126, 0, 0, 0, 0, 42, 28, 62, 28, 42, 0, 0, 0, 8, 8, 62, 8, 8, 0, 0, 0, 0, 0, 128, 96, 0, 0, 0, 0, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, 0, 64, 32, 16, 8, 4, 2, 0, 0, 62, 65, 73, 65, 62, 0, 0, 0, 0, 66, 127, 64, 0, 0, 0, 0, 0, 98, 81, 73, 70, 0, 0, 0, 0, 34, 73, 73, 54, 0, 0, 0, 0, 14, 8, 127, 8, 0, 0, 0, 0, 35, 69, 69, 57, 0, 0, 0, 0, 62, 73, 73, 50, 0, 0, 0, 0, 1, 97, 25, 7, 0, 0, 0, 0, 54, 73, 73, 54, 0, 0, 0, 0, 6, 9, 9, 126, 0, 0, 0, 0, 0, 102, 0, 0, 0, 0, 0, 0, 128, 102, 0, 0, 0, 0, 0, 0, 8, 20, 34, 65, 0, 0, 0, 0, 20, 20, 20, 20, 0, 0, 0, 0, 65, 34, 20, 8, 0, 0, 0, 2, 1, 81, 9, 6, 0, 0, 0, 28, 34, 89, 89, 82, 12, 0, 0, 0, 126, 9, 9, 126, 0, 0, 0, 0, 127, 73, 73, 54, 0, 0, 0, 0, 62, 65, 65, 34, 0, 0, 0, 0, 127, 65, 65, 62, 0, 0, 0, 0, 127, 73, 73, 65, 0, 0, 0, 0, 127, 9, 9, 1, 0, 0, 0, 0, 62, 65, 81, 50, 0, 0, 0, 0, 127, 8, 8, 127, 0, 0, 0, 0, 65, 127, 65, 0, 0, 0, 0, 0, 32, 64, 64, 63, 0, 0, 0, 0, 127, 8, 20, 99, 0, 0, 0, 0, 127, 64, 64, 64, 0, 0, 0, 127, 2, 4, 2, 127, 0, 0, 0, 127, 6, 8, 48, 127, 0, 0, 0, 0, 62, 65, 65, 62, 0, 0, 0, 0, 127, 9, 9, 6, 0, 0, 0, 0, 62, 65, 97, 126, 64, 0, 0, 0, 127, 9, 9, 118, 0, 0, 0, 0, 38, 73, 73, 50, 0, 0, 0, 1, 1, 127, 1, 1, 0, 0, 0, 0, 63, 64, 64, 63, 0, 0, 0, 31, 32, 64, 32, 31, 0, 0, 0, 63, 64, 48, 64, 63, 0, 0, 0, 0, 119, 8, 8, 119, 0, 0, 0, 3, 4, 120, 4, 3, 0, 0, 0, 0, 113, 73, 73, 71, 0, 0, 0, 0, 127, 65, 65, 0, 0, 0, 0, 2, 4, 8, 16, 32, 64, 0, 0, 0, 0, 65, 65, 127, 0, 0, 0, 4, 2, 1, 2, 4, 0, 0, 0, 64, 64, 64, 64, 64, 64, 0, 0, 0, 1, 2, 4, 0, 0, 0, 0, 0, 48, 72, 40, 120, 0, 0, 0, 0, 127, 72, 72, 48, 0, 0, 0, 0, 48, 72, 72, 0, 0, 0, 0, 0, 48, 72, 72, 127, 0, 0, 0, 0, 48, 88, 88, 16, 0, 0, 0, 0, 126, 9, 1, 2, 0, 0, 0, 0, 80, 152, 152, 112, 0, 0, 0, 0, 127, 8, 8, 112, 0, 0, 0, 0, 0, 122, 0, 0, 0, 0, 0, 0, 64, 128, 128, 122, 0, 0, 0, 0, 127, 16, 40, 72, 0, 0, 0, 0, 0, 127, 0, 0, 0, 0, 0, 120, 8, 16, 8, 112, 0, 0, 0, 0, 120, 8, 8, 112, 0, 0, 0, 0, 48, 72, 72, 48, 0, 0, 0, 0, 248, 40, 40, 16, 0, 0, 0, 0, 16, 40, 40, 248, 0, 0, 0, 0, 112, 8, 8, 16, 0, 0, 0, 0, 72, 84, 84, 36, 0, 0, 0, 0, 8, 60, 72, 32, 0, 0, 0, 0, 56, 64, 32, 120, 0, 0, 0, 0, 56, 64, 56, 0, 0, 0, 0, 56, 64, 32, 64, 56, 0, 0, 0, 0, 72, 48, 48, 72, 0, 0, 0, 0, 24, 160, 160, 120, 0, 0, 0, 0, 100, 84, 84, 76, 0, 0, 0, 0, 8, 28, 34, 65, 0, 0, 0, 0, 0, 126, 0, 0, 0, 0, 0, 0, 65, 34, 28, 8, 0, 0, 0, 0, 4, 2, 4, 2, 0, 0, 0, 120, 68, 66, 68, 120, 0, 0, };/* Declare bitmap array containing font */ //Above data copied directly from lab 3