Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Arduboy2.h>
- const unsigned char PlayFieldTiles[] PROGMEM = {0xf0, 0x0c, 0x02, 0xe2, 0x11, 0x09, 0x09, 0x09,
- 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09,
- 0x09, 0x09, 0x09, 0x11, 0xe1, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0xe1, 0x11, 0x09, 0x09, 0x09,
- 0x09, 0x09, 0x09, 0x11, 0xe2, 0x02, 0x0c, 0xf0,
- 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff,
- 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x10, 0x10,
- 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
- 0x10, 0x10, 0x20, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x08, 0x08,
- 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
- 0x08, 0x08, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00,
- 0x08, 0x08, 0x08, 0x10, 0xe0, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0xe0, 0x10, 0x08, 0x08, 0x08,
- 0x0f, 0x30, 0x40, 0x47, 0x88, 0x90, 0x90, 0x90,
- 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
- 0x00, 0x00, 0x00, 0x07, 0x08, 0x10, 0x10, 0x10,
- 0x10, 0x10, 0x10, 0x08, 0x07, 0x00, 0x00, 0x00,
- 0x90, 0x90, 0x90, 0x88, 0x47, 0x40, 0x30, 0x0f,
- 0x00, 0x00, 0x00, 0x00, 0xf0, 0x10, 0x10, 0x90,
- 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0xf0,
- 0x40, 0x20, 0x40, 0x20, 0x40, 0x20, 0x40, 0x20,
- 0xf0, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
- 0x90, 0x10, 0x10, 0xf0, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0f, 0x08, 0x08, 0x09,
- 0x09, 0x08, 0x08, 0x0f, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0x00, 0x00, 0x07, 0x08, 0x10, 0x10, 0x10,
- 0x10, 0x10, 0x10, 0x08, 0x07, 0x00, 0x00, 0xff,
- 0xff, 0x00, 0x00, 0xe0, 0x10, 0x08, 0x08, 0x08,
- 0x08, 0x08, 0x08, 0x10, 0xe0, 0x00, 0x00, 0xff,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- };
- const unsigned char PlayFieldMap[] PROGMEM = {0,1,1,1,1,1,1,1,1,1,1,1,1,2,3,1,1,1,1,1,1,1,1,1,1,1,1,4,5,6,6,6,6,6,6,6,6,6,6,6,6,7,8,6,6,6,6,6,6,6,6,6,6,6,6,9,5,6,10,11,11,12,6,10,11,11,11,12,6,7,8,6,10,11,11,11,12,6,10,11,11,12,6,9,5,6,7,6,6,8,6,7,6,6,6,8,6,7,8,6,7,6,6,6,8,6,7,6,6,8,6,9,5,6,13,14,14,15,6,13,14,14,14,15,6,13,15,6,13,14,14,14,15,6,13,14,14,15,6,9,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,9,5,6,10,11,11,12,6,10,12,6,10,11,11,11,11,11,11,12,6,10,12,6,10,11,11,12,6,9,5,6,13,14,14,15,6,7,8,6,13,14,14,16,17,14,14,15,6,7,8,6,13,14,14,15,6,9,5,6,6,6,6,6,6,7,8,6,6,6,6,7,8,6,6,6,6,7,8,6,6,6,6,6,6,9,18,19,19,19,19,12,6,7,20,11,11,12,6,7,8,6,10,11,11,21,8,6,10,19,19,19,19,22,6,6,6,6,6,5,6,7,17,14,14,15,6,13,15,6,13,14,14,16,8,6,9,6,6,6,6,6,6,6,6,6,6,5,6,7,8,6,6,6,6,6,6,6,6,6,6,7,8,6,9,6,6,6,6,6,6,6,6,6,6,5,6,7,8,6,23,19,24,25,25,26,19,27,6,7,8,6,9,6,6,6,6,6,1,1,1,1,1,15,6,13,15,6,9,6,6,6,6,6,6,5,6,13,15,6,13,1,1,1,1,1,6,6,6,6,6,6,6,6,6,6,9,6,6,6,6,6,6,5,6,6,6,6,6,6,6,6,6,6,19,19,19,19,19,12,6,10,12,6,9,6,6,6,6,6,6,5,6,10,12,6,10,19,19,19,19,19,6,6,6,6,6,5,6,7,8,6,28,1,1,1,1,1,1,29,6,7,8,6,9,6,6,6,6,6,6,6,6,6,6,5,6,7,8,6,6,6,6,6,6,6,6,6,6,7,8,6,9,6,6,6,6,6,6,6,6,6,6,5,6,7,8,6,10,11,11,11,11,11,11,12,6,7,8,6,9,6,6,6,6,6,0,1,1,1,1,15,6,13,15,6,13,14,14,16,17,14,14,15,6,13,15,6,13,1,1,1,1,4,5,6,6,6,6,6,6,6,6,6,6,6,6,7,8,6,6,6,6,6,6,6,6,6,6,6,6,9,5,6,10,11,11,12,6,10,11,11,11,12,6,7,8,6,10,11,11,11,12,6,10,11,11,12,6,9,5,6,13,14,16,8,6,13,14,14,14,15,6,13,15,6,13,14,14,14,15,6,7,17,14,15,6,9,5,6,6,6,7,8,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,8,6,6,6,9,30,11,12,6,7,8,6,10,12,6,10,11,11,11,11,11,11,12,6,10,12,6,7,8,6,10,11,31,32,14,15,6,13,15,6,7,8,6,13,14,14,16,17,14,14,15,6,7,8,6,13,15,6,13,14,33,5,6,6,6,6,6,6,7,8,6,6,6,6,7,8,6,6,6,6,7,8,6,6,6,6,6,6,9,5,6,10,11,11,11,11,21,20,11,11,12,6,7,8,6,10,11,11,21,20,11,11,11,11,12,6,9,5,6,13,14,14,14,14,14,14,14,14,15,6,13,15,6,13,14,14,14,14,14,14,14,14,15,6,9,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,9,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,22};
- Arduboy2 arduboy;
- void setup() {
- arduboy.boot(); // Changing this to begin() will draw the first tile three times
- arduboy.setFrameRate(1);
- }
- void loop() {
- if (!(arduboy.nextFrame())) {
- return;
- }
- arduboy.clear();
- updateTiles();
- arduboy.display();
- }
- void updateTiles() {
- unsigned int i = 0;
- for (int y = 0 ; y < 1 ; y++ ) {
- for (int x = 0 ; x < 3 ; x++ ) { // increasing 3 will only draw the first tile
- unsigned char idx = PlayFieldMap[i];
- arduboy.drawBitmap(x * 8, y * 8, PlayFieldTiles + (idx << 3), 8, 8, WHITE);
- i++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement