Simple fish eat program

Dependencies:   mbed mbed-rtos N5110 ShiftReg Tone

Committer:
el18a2k
Date:
Fri Mar 19 16:27:52 2021 +0000
Revision:
0:cf9660998431
Child:
1:7dfa61225fcf
Title sequence built, thread_sleep_for() bug fixed by reverting to previous MBED OS

Who changed what in which revision?

UserRevisionLine numberNew contents of line
el18a2k 0:cf9660998431 1 #include "Graphics.h"
el18a2k 0:cf9660998431 2
el18a2k 0:cf9660998431 3 void Graphics::titleScreen(N5110 &lcd){
el18a2k 0:cf9660998431 4 // x y
el18a2k 0:cf9660998431 5 const int F[20][12] = {
el18a2k 0:cf9660998431 6 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 7 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 8 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 9 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 10 { 1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 11 { 1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 12 { 1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 13 { 1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 14 { 1,1,1,1,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 15 { 1,1,1,1,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 16 { 1,1,1,1,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 17 { 1,1,1,1,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 18 { 1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 19 { 1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 20 { 1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 21 { 1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 22 { 1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 23 { 1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 24 { 1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 25 { 1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 26 };
el18a2k 0:cf9660998431 27
el18a2k 0:cf9660998431 28 // x y
el18a2k 0:cf9660998431 29 const int I[20][4] = {
el18a2k 0:cf9660998431 30 { 1,1,1,1, },
el18a2k 0:cf9660998431 31 { 1,1,1,1, },
el18a2k 0:cf9660998431 32 { 1,1,1,1, },
el18a2k 0:cf9660998431 33 { 1,1,1,1, },
el18a2k 0:cf9660998431 34 { 1,1,1,1, },
el18a2k 0:cf9660998431 35 { 1,1,1,1, },
el18a2k 0:cf9660998431 36 { 1,1,1,1, },
el18a2k 0:cf9660998431 37 { 1,1,1,1, },
el18a2k 0:cf9660998431 38 { 1,1,1,1, },
el18a2k 0:cf9660998431 39 { 1,1,1,1, },
el18a2k 0:cf9660998431 40 { 1,1,1,1, },
el18a2k 0:cf9660998431 41 { 1,1,1,1, },
el18a2k 0:cf9660998431 42 { 1,1,1,1, },
el18a2k 0:cf9660998431 43 { 1,1,1,1, },
el18a2k 0:cf9660998431 44 { 1,1,1,1, },
el18a2k 0:cf9660998431 45 { 1,1,1,1, },
el18a2k 0:cf9660998431 46 { 1,1,1,1, },
el18a2k 0:cf9660998431 47 { 1,1,1,1, },
el18a2k 0:cf9660998431 48 { 1,1,1,1, },
el18a2k 0:cf9660998431 49 { 1,1,1,1, },
el18a2k 0:cf9660998431 50 };
el18a2k 0:cf9660998431 51
el18a2k 0:cf9660998431 52 // x y
el18a2k 0:cf9660998431 53 const int S[20][12] = {
el18a2k 0:cf9660998431 54 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 55 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 56 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 57 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 58 { 1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 59 { 1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 60 { 1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 61 { 1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 62 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 63 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 64 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 65 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 66 { 0,0,0,0,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 67 { 0,0,0,0,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 68 { 0,0,0,0,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 69 { 0,0,0,0,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 70 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 71 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 72 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 73 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 74 };
el18a2k 0:cf9660998431 75
el18a2k 0:cf9660998431 76 // x y
el18a2k 0:cf9660998431 77 const int H[20][12] = {
el18a2k 0:cf9660998431 78 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 79 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 80 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 81 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 82 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 83 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 84 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 85 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 86 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 87 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 88 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 89 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 90 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 91 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 92 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 93 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 94 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 95 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 96 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 97 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 98 };
el18a2k 0:cf9660998431 99
el18a2k 0:cf9660998431 100 // x y
el18a2k 0:cf9660998431 101 const int E[20][12] = {
el18a2k 0:cf9660998431 102 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 103 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 104 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 105 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 106 { 1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 107 { 1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 108 { 1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 109 { 1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 110 { 1,1,1,1,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 111 { 1,1,1,1,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 112 { 1,1,1,1,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 113 { 1,1,1,1,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 114 { 1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 115 { 1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 116 { 1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 117 { 1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 118 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 119 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 120 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 121 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 122 };
el18a2k 0:cf9660998431 123
el18a2k 0:cf9660998431 124 // x y
el18a2k 0:cf9660998431 125 const int A[20][12] = {
el18a2k 0:cf9660998431 126 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 127 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 128 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 129 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 130 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 131 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 132 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 133 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 134 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 135 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 136 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 137 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 138 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 139 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 140 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 141 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 142 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 143 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 144 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 145 { 1,1,1,1,0,0,0,0,1,1,1,1, },
el18a2k 0:cf9660998431 146 };
el18a2k 0:cf9660998431 147
el18a2k 0:cf9660998431 148 // x y
el18a2k 0:cf9660998431 149 const int T[20][12] = {
el18a2k 0:cf9660998431 150 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 151 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 152 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 153 { 1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 154 { 0,0,0,0,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 155 { 0,0,0,0,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 156 { 0,0,0,0,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 157 { 0,0,0,0,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 158 { 0,0,0,0,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 159 { 0,0,0,0,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 160 { 0,0,0,0,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 161 { 0,0,0,0,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 162 { 0,0,0,0,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 163 { 0,0,0,0,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 164 { 0,0,0,0,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 165 { 0,0,0,0,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 166 { 0,0,0,0,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 167 { 0,0,0,0,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 168 { 0,0,0,0,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 169 { 0,0,0,0,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 170 };
el18a2k 0:cf9660998431 171
el18a2k 0:cf9660998431 172 lcd.drawRect(0,0,84,48,FILL_TRANSPARENT); //draws screen border
el18a2k 0:cf9660998431 173
el18a2k 0:cf9660998431 174 //X Y x y
el18a2k 0:cf9660998431 175 lcd.drawSprite(3,2,20,12,(int *)F);
el18a2k 0:cf9660998431 176 lcd.drawSprite(19,2,20,4,(int *)I);
el18a2k 0:cf9660998431 177 lcd.drawSprite(27,2,20,12,(int *)S);
el18a2k 0:cf9660998431 178 lcd.drawSprite(43,2,20,12,(int *)H);
el18a2k 0:cf9660998431 179
el18a2k 0:cf9660998431 180 lcd.drawSprite(3,26,20,12,(int *)E);
el18a2k 0:cf9660998431 181 lcd.drawSprite(19,26,20,12,(int *)A);
el18a2k 0:cf9660998431 182 lcd.drawSprite(35,26,20,12,(int *)T);
el18a2k 0:cf9660998431 183 }
el18a2k 0:cf9660998431 184
el18a2k 0:cf9660998431 185 void Graphics::confirmationScreen(N5110 &lcd){
el18a2k 0:cf9660998431 186 // x y
el18a2k 0:cf9660998431 187 const int Title_fish[44][21] = {
el18a2k 0:cf9660998431 188 { 0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 189 { 0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 190 { 0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 191 { 0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,1,0,0,0,0,0, },
el18a2k 0:cf9660998431 192 { 0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 193 { 0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0, },
el18a2k 0:cf9660998431 194 { 0,0,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0, },
el18a2k 0:cf9660998431 195 { 0,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0, },
el18a2k 0:cf9660998431 196 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 197 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 198 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 199 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 200 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 201 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 202 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 203 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 204 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 205 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 206 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 207 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 208 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 209 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 210 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 211 { 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0, },
el18a2k 0:cf9660998431 212 { 0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0, },
el18a2k 0:cf9660998431 213 { 0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0, },
el18a2k 0:cf9660998431 214 { 0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 215 { 0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, },
el18a2k 0:cf9660998431 216 { 0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 217 { 0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 218 { 0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 219 { 0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 220 { 0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 221 { 0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 222 { 0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 223 { 0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 224 { 0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 225 { 0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 226 { 0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, },
el18a2k 0:cf9660998431 227 { 0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 228 { 0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0, },
el18a2k 0:cf9660998431 229 { 0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0, },
el18a2k 0:cf9660998431 230 { 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0, },
el18a2k 0:cf9660998431 231 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 232 };
el18a2k 0:cf9660998431 233
el18a2k 0:cf9660998431 234 // x y
el18a2k 0:cf9660998431 235 const int Title_fish_eaten[44][21] = {
el18a2k 0:cf9660998431 236 { 0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 237 { 0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 238 { 0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 239 { 0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,1,0,0,0,0,0, },
el18a2k 0:cf9660998431 240 { 0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 241 { 0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0, },
el18a2k 0:cf9660998431 242 { 0,0,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0, },
el18a2k 0:cf9660998431 243 { 0,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0, },
el18a2k 0:cf9660998431 244 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 245 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 246 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 247 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 248 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 249 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, },
el18a2k 0:cf9660998431 250 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 251 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 252 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 253 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 254 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, },
el18a2k 0:cf9660998431 255 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 256 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, },
el18a2k 0:cf9660998431 257 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 258 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 259 { 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, },
el18a2k 0:cf9660998431 260 { 0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 261 { 0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0, },
el18a2k 0:cf9660998431 262 { 0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 263 { 0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, },
el18a2k 0:cf9660998431 264 { 0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 265 { 0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 266 { 0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 267 { 0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 268 { 0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 269 { 0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 270 { 0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 271 { 0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 272 { 0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 273 { 0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 274 { 0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, },
el18a2k 0:cf9660998431 275 { 0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 276 { 0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0, },
el18a2k 0:cf9660998431 277 { 0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0, },
el18a2k 0:cf9660998431 278 { 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0, },
el18a2k 0:cf9660998431 279 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 280 };
el18a2k 0:cf9660998431 281
el18a2k 0:cf9660998431 282 lcd.clear();
el18a2k 0:cf9660998431 283 lcd.drawRect(0,0,84,48,FILL_TRANSPARENT); //draws screen border
el18a2k 0:cf9660998431 284 lcd.printString("Hold",12,2);
el18a2k 0:cf9660998431 285 lcd.printString("A",24,3);
el18a2k 0:cf9660998431 286 lcd.drawSprite(59,2,44,21,(int*)Title_fish);
el18a2k 0:cf9660998431 287 lcd.refresh(); // refresh the LCD so the pixels appear
el18a2k 0:cf9660998431 288 wait_ms(1000);
el18a2k 0:cf9660998431 289 lcd.drawSprite(59,2,44,21,(int*)Title_fish_eaten);
el18a2k 0:cf9660998431 290 lcd.refresh();
el18a2k 0:cf9660998431 291 }
el18a2k 0:cf9660998431 292
el18a2k 0:cf9660998431 293 void Graphics::screenFlash(N5110 &lcd){
el18a2k 0:cf9660998431 294 int i = 0;
el18a2k 0:cf9660998431 295
el18a2k 0:cf9660998431 296 while(i<4){
el18a2k 0:cf9660998431 297 lcd.inverseMode();
el18a2k 0:cf9660998431 298 lcd.refresh();
el18a2k 0:cf9660998431 299 wait_ms(100);
el18a2k 0:cf9660998431 300 lcd.normalMode();
el18a2k 0:cf9660998431 301 lcd.refresh();
el18a2k 0:cf9660998431 302 wait_ms(100);
el18a2k 0:cf9660998431 303 i++;
el18a2k 0:cf9660998431 304 }
el18a2k 0:cf9660998431 305 }
el18a2k 0:cf9660998431 306
el18a2k 0:cf9660998431 307 void Graphics::Fish_1(N5110 &lcd){
el18a2k 0:cf9660998431 308 // x y
el18a2k 0:cf9660998431 309 const int Fish_1[4][9]= {
el18a2k 0:cf9660998431 310 { 1,0,0,1,1,1,1,1,0, },
el18a2k 0:cf9660998431 311 { 1,1,1,1,1,1,1,0,1, },
el18a2k 0:cf9660998431 312 { 1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 313 { 1,0,0,1,1,1,1,1,0, },
el18a2k 0:cf9660998431 314 };
el18a2k 0:cf9660998431 315
el18a2k 0:cf9660998431 316 //pos / sprite x y / x y
el18a2k 0:cf9660998431 317 lcd.drawSprite(2,2,4,9,(int*)Fish_1);
el18a2k 0:cf9660998431 318 }
el18a2k 0:cf9660998431 319
el18a2k 0:cf9660998431 320 void Graphics::Fish_2(N5110 &lcd){
el18a2k 0:cf9660998431 321 // x y
el18a2k 0:cf9660998431 322 const int Fish_2[6][14] = {
el18a2k 0:cf9660998431 323 { 1,0,0,0,0,1,1,1,1,1,1,1,0,0, },
el18a2k 0:cf9660998431 324 { 1,1,0,0,1,1,1,1,1,1,0,1,1,0, },
el18a2k 0:cf9660998431 325 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 326 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 327 { 1,1,0,0,1,1,1,1,1,1,1,1,1,0, },
el18a2k 0:cf9660998431 328 { 1,0,0,0,0,1,1,1,1,1,1,1,0,0, },
el18a2k 0:cf9660998431 329 };
el18a2k 0:cf9660998431 330
el18a2k 0:cf9660998431 331 //pos / sprite x y / x y
el18a2k 0:cf9660998431 332 lcd.drawSprite(2,8,6,14,(int*)Fish_2);
el18a2k 0:cf9660998431 333 }
el18a2k 0:cf9660998431 334
el18a2k 0:cf9660998431 335 void Graphics::Fish_3(N5110 &lcd){
el18a2k 0:cf9660998431 336 // x y
el18a2k 0:cf9660998431 337 const int Fish_3[8][17] = {
el18a2k 0:cf9660998431 338 { 1,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0 },
el18a2k 0:cf9660998431 339 { 1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0 },
el18a2k 0:cf9660998431 340 { 1,1,1,0,0,1,1,1,1,1,1,1,1,0,1,1,0 },
el18a2k 0:cf9660998431 341 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 },
el18a2k 0:cf9660998431 342 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 },
el18a2k 0:cf9660998431 343 { 1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0 },
el18a2k 0:cf9660998431 344 { 1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0 },
el18a2k 0:cf9660998431 345 { 1,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0 },
el18a2k 0:cf9660998431 346 };
el18a2k 0:cf9660998431 347
el18a2k 0:cf9660998431 348 //pos / sprite x y / x y
el18a2k 0:cf9660998431 349 lcd.drawSprite(2,16,8,17,(int*)Fish_3);
el18a2k 0:cf9660998431 350 }
el18a2k 0:cf9660998431 351
el18a2k 0:cf9660998431 352
el18a2k 0:cf9660998431 353 void Graphics::Fish_4(N5110 &lcd){
el18a2k 0:cf9660998431 354 // x y
el18a2k 0:cf9660998431 355 const int Fish_4[12][23] = {
el18a2k 0:cf9660998431 356 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 357 { 0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0, },
el18a2k 0:cf9660998431 358 { 1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 359 { 1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0, },
el18a2k 0:cf9660998431 360 { 1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0, },
el18a2k 0:cf9660998431 361 { 1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0, },
el18a2k 0:cf9660998431 362 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 363 { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, },
el18a2k 0:cf9660998431 364 { 1,1,1,1,0,0,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,0, },
el18a2k 0:cf9660998431 365 { 1,1,1,0,0,0,0,1,1,1,1,1,1,0,0,1,1,1,1,0,0,0,0, },
el18a2k 0:cf9660998431 366 { 1,1,0,0,0,0,0,0,1,1,1,1,1,0,1,1,1,1,1,1,1,0,0, },
el18a2k 0:cf9660998431 367 { 1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0, },
el18a2k 0:cf9660998431 368 };
el18a2k 0:cf9660998431 369
el18a2k 0:cf9660998431 370 //pos / sprite x y / x y
el18a2k 0:cf9660998431 371 lcd.drawSprite(2,26,12,23,(int*)Fish_4);
el18a2k 0:cf9660998431 372 }
el18a2k 0:cf9660998431 373
el18a2k 0:cf9660998431 374
el18a2k 0:cf9660998431 375 void Graphics::upArrow(N5110 &lcd){
el18a2k 0:cf9660998431 376 // x y
el18a2k 0:cf9660998431 377 const int upArrow[3][6] = {
el18a2k 0:cf9660998431 378 { 0,0,1,1,0,0, },
el18a2k 0:cf9660998431 379 { 0,1,1,1,1,0, },
el18a2k 0:cf9660998431 380 { 1,1,1,1,1,1, },
el18a2k 0:cf9660998431 381 };
el18a2k 0:cf9660998431 382
el18a2k 0:cf9660998431 383 //pos / sprite x y / x y
el18a2k 0:cf9660998431 384 lcd.drawSprite(30,2,3,6,(int*)upArrow);
el18a2k 0:cf9660998431 385 }
el18a2k 0:cf9660998431 386
el18a2k 0:cf9660998431 387
el18a2k 0:cf9660998431 388 void Graphics::downArrow(N5110 &lcd){
el18a2k 0:cf9660998431 389 // x y
el18a2k 0:cf9660998431 390 const int downArrow[3][6] = {
el18a2k 0:cf9660998431 391 { 1,1,1,1,1,1, },
el18a2k 0:cf9660998431 392 { 0,1,1,1,1,0, },
el18a2k 0:cf9660998431 393 { 0,0,1,1,0,0, },
el18a2k 0:cf9660998431 394 };
el18a2k 0:cf9660998431 395
el18a2k 0:cf9660998431 396 //pos / sprite x y / x y
el18a2k 0:cf9660998431 397 lcd.drawSprite(30,7,3,6,(int*)downArrow);
el18a2k 0:cf9660998431 398 }
el18a2k 0:cf9660998431 399
el18a2k 0:cf9660998431 400
el18a2k 0:cf9660998431 401 void Graphics::leftArrow(N5110 &lcd){
el18a2k 0:cf9660998431 402 // x y
el18a2k 0:cf9660998431 403 const int leftArrow[6][3] = {
el18a2k 0:cf9660998431 404 { 0,0,1, },
el18a2k 0:cf9660998431 405 { 0,1,1, },
el18a2k 0:cf9660998431 406 { 1,1,1, },
el18a2k 0:cf9660998431 407 { 1,1,1, },
el18a2k 0:cf9660998431 408 { 0,1,1, },
el18a2k 0:cf9660998431 409 { 0,0,1, },
el18a2k 0:cf9660998431 410 };
el18a2k 0:cf9660998431 411
el18a2k 0:cf9660998431 412 //pos / sprite x y / x y
el18a2k 0:cf9660998431 413 lcd.drawSprite(30,12,6,3,(int*)leftArrow);
el18a2k 0:cf9660998431 414 }
el18a2k 0:cf9660998431 415
el18a2k 0:cf9660998431 416
el18a2k 0:cf9660998431 417 void Graphics::rightArrow(N5110 &lcd){
el18a2k 0:cf9660998431 418 // x y
el18a2k 0:cf9660998431 419 const int rightArrow[6][3] = {
el18a2k 0:cf9660998431 420 { 1,0,0, },
el18a2k 0:cf9660998431 421 { 1,1,0, },
el18a2k 0:cf9660998431 422 { 1,1,1, },
el18a2k 0:cf9660998431 423 { 1,1,1, },
el18a2k 0:cf9660998431 424 { 1,1,0, },
el18a2k 0:cf9660998431 425 { 1,0,0, },
el18a2k 0:cf9660998431 426 };
el18a2k 0:cf9660998431 427
el18a2k 0:cf9660998431 428 //pos / sprite x y / x y
el18a2k 0:cf9660998431 429 lcd.drawSprite(30,20,6,3,(int*)rightArrow);
el18a2k 0:cf9660998431 430 }
el18a2k 0:cf9660998431 431
el18a2k 0:cf9660998431 432
el18a2k 0:cf9660998431 433 void Graphics::Waves(N5110 &lcd){
el18a2k 0:cf9660998431 434 // x y
el18a2k 0:cf9660998431 435 const int waves[4][14] = {
el18a2k 0:cf9660998431 436 { 0,0,1,0,0,0,0,0,0,1,0,0,0,0, },
el18a2k 0:cf9660998431 437 { 0,1,1,1,0,0,0,0,1,1,1,0,0,0, },
el18a2k 0:cf9660998431 438 { 1,0,0,0,1,0,0,1,0,0,0,1,0,0, },
el18a2k 0:cf9660998431 439 { 0,0,0,0,0,1,1,0,0,0,0,0,1,1, },
el18a2k 0:cf9660998431 440 };
el18a2k 0:cf9660998431 441
el18a2k 0:cf9660998431 442 int x = 0;
el18a2k 0:cf9660998431 443 int y = 44;
el18a2k 0:cf9660998431 444 int i = 0;
el18a2k 0:cf9660998431 445
el18a2k 0:cf9660998431 446 while(y>0){
el18a2k 0:cf9660998431 447 lcd.clear();
el18a2k 0:cf9660998431 448 lcd.drawRect(0,0,84,48,FILL_TRANSPARENT); //draws screen border
el18a2k 0:cf9660998431 449 while(x < 83){
el18a2k 0:cf9660998431 450 lcd.drawSprite(x,y,4,14,(int *)waves);
el18a2k 0:cf9660998431 451 x=x+14;
el18a2k 0:cf9660998431 452 }
el18a2k 0:cf9660998431 453 y=y-5;
el18a2k 0:cf9660998431 454 lcd.refresh();
el18a2k 0:cf9660998431 455 }
el18a2k 0:cf9660998431 456 }