Image library for all the graph. Just test
Image.cpp@0:da6e8a366665, 2019-03-31 (annotated)
- Committer:
- MYY
- Date:
- Sun Mar 31 18:40:48 2019 +0000
- Revision:
- 0:da6e8a366665
- Child:
- 1:298e74e9170b
Image contains the distribution of rock and gold in the first round.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MYY | 0:da6e8a366665 | 1 | #include "Image.h" |
MYY | 0:da6e8a366665 | 2 | |
MYY | 0:da6e8a366665 | 3 | |
MYY | 0:da6e8a366665 | 4 | Image::Image() |
MYY | 0:da6e8a366665 | 5 | { |
MYY | 0:da6e8a366665 | 6 | } |
MYY | 0:da6e8a366665 | 7 | |
MYY | 0:da6e8a366665 | 8 | Image::~Image() |
MYY | 0:da6e8a366665 | 9 | { |
MYY | 0:da6e8a366665 | 10 | } |
MYY | 0:da6e8a366665 | 11 | |
MYY | 0:da6e8a366665 | 12 | |
MYY | 0:da6e8a366665 | 13 | |
MYY | 0:da6e8a366665 | 14 | //mine |
MYY | 0:da6e8a366665 | 15 | int BigGold[5][8]= { |
MYY | 0:da6e8a366665 | 16 | { 0,0,1,1,1,0,0,0 }, |
MYY | 0:da6e8a366665 | 17 | { 0,0,1,0,0,1,1,0 }, |
MYY | 0:da6e8a366665 | 18 | { 0,1,0,0,0,0,0,1 }, |
MYY | 0:da6e8a366665 | 19 | { 1,0,0,0,0,0,0,1 }, |
MYY | 0:da6e8a366665 | 20 | { 0,1,1,1,1,1,1,0 }, |
MYY | 0:da6e8a366665 | 21 | }; |
MYY | 0:da6e8a366665 | 22 | |
MYY | 0:da6e8a366665 | 23 | int SmallGold[4][3]= { |
MYY | 0:da6e8a366665 | 24 | { 0,1,1 }, |
MYY | 0:da6e8a366665 | 25 | { 1,0,1 }, |
MYY | 0:da6e8a366665 | 26 | { 1,0,1 }, |
MYY | 0:da6e8a366665 | 27 | { 1,1,1 }, |
MYY | 0:da6e8a366665 | 28 | }; |
MYY | 0:da6e8a366665 | 29 | |
MYY | 0:da6e8a366665 | 30 | int BigRock[8][10]= { |
MYY | 0:da6e8a366665 | 31 | { 0,0,0,0,1,1,1,0,0,0 }, |
MYY | 0:da6e8a366665 | 32 | { 0,0,1,1,1,1,1,1,1,0 }, |
MYY | 0:da6e8a366665 | 33 | { 0,1,1,1,1,1,1,1,1,0 }, |
MYY | 0:da6e8a366665 | 34 | { 1,1,1,1,1,1,1,1,1,0 }, |
MYY | 0:da6e8a366665 | 35 | { 1,1,1,1,1,1,1,1,1,0 }, |
MYY | 0:da6e8a366665 | 36 | { 1,1,1,1,1,1,1,1,1,1 }, |
MYY | 0:da6e8a366665 | 37 | { 0,1,1,1,1,1,1,1,1,1 }, |
MYY | 0:da6e8a366665 | 38 | { 0,1,1,1,1,1,1,1,1,1 }, |
MYY | 0:da6e8a366665 | 39 | }; |
MYY | 0:da6e8a366665 | 40 | |
MYY | 0:da6e8a366665 | 41 | |
MYY | 0:da6e8a366665 | 42 | |
MYY | 0:da6e8a366665 | 43 | // level 1 mine |
MYY | 0:da6e8a366665 | 44 | int level_1_x[7]= {15, 38, 50, 25, 70, 27, 60}; |
MYY | 0:da6e8a366665 | 45 | int level_1_y[7]= {10, 30, 25, 30, 37, 13, 20}; |
MYY | 0:da6e8a366665 | 46 | |
MYY | 0:da6e8a366665 | 47 | |
MYY | 0:da6e8a366665 | 48 | void Image::draw_1(N5110 &lcd) |
MYY | 0:da6e8a366665 | 49 | { |
MYY | 0:da6e8a366665 | 50 | int i; |
MYY | 0:da6e8a366665 | 51 | //big gold |
MYY | 0:da6e8a366665 | 52 | for(i=0; i<3; i=i+1) { |
MYY | 0:da6e8a366665 | 53 | lcd.drawSprite(level_1_x[i],level_1_y[i], 5, 8, (int*)BigGold); |
MYY | 0:da6e8a366665 | 54 | }; |
MYY | 0:da6e8a366665 | 55 | // small gold |
MYY | 0:da6e8a366665 | 56 | for(i=3; i<5; i=i+1) { |
MYY | 0:da6e8a366665 | 57 | lcd.drawSprite(level_1_x[i], level_1_y[i], 4, 3, (int*)SmallGold); |
MYY | 0:da6e8a366665 | 58 | }; |
MYY | 0:da6e8a366665 | 59 | //Big rock |
MYY | 0:da6e8a366665 | 60 | for(i=5; i<7; i=i+1) { |
MYY | 0:da6e8a366665 | 61 | lcd.drawSprite(level_1_x[i], level_1_y[i], 8, 10, (int*)BigRock); |
MYY | 0:da6e8a366665 | 62 | } |
MYY | 0:da6e8a366665 | 63 | } |
MYY | 0:da6e8a366665 | 64 | //Rotate |