diff --git a/My_settings.h b/My_settings.h new file mode 100644 index 0000000..7c48b90 --- /dev/null +++ b/My_settings.h @@ -0,0 +1,7 @@ +#ifndef MY_SETTINGS_H +#define MY_SETTINGS_H + +#define PROJ_SCREENMODE 2 +#define PROJ_ENABLE_SOUND 0 + +#endif \ No newline at end of file diff --git a/README.MD b/README.MD new file mode 100644 index 0000000..19c668a --- /dev/null +++ b/README.MD @@ -0,0 +1,25 @@ +# Raquer * Mete + +It's a clone of the minigame [Hack*Match](https://www.youtube.com/watch?v=socMP6jpA_A) in the excellent [Exapunks](http://www.zachtronics.com/exapunks/), made for the [Pokitto](https://www.pokitto.com/). + +It's a rather faithful clone, including freezing time, combos, bombs, and same number of lines and columns. The most notable missing feature is the speed not increasing over time in this version. + +The game does not have sound, at least yet. I may add sfx later on. I may also fine-tune freenzing time, bomb rate, falling speed, the **color palette**, etc. + +You can find a video of the game running on the [emulator](https://github.com/felipemanga/PokittoEmu) with this [link](https://youtu.be/QAOuVoEG2bc) and on the **actual Pokitto** [here](https://youtu.be/mi8BovujRD0). + +Disclaimer about the name: it's a joke that only makes sense in Portuguese. + +**Have fun!** + +## Note +First, I coded this game exclusively for fun. + +This code is a *complete* mess and sure isn't a good depiction of the usual quality of my code. +I'll admit that I have almost null experience with embedding programming. I just *felt* (with some reasoning) like the right thing to do would be to avoid any and all use of the heap (especially for larger structures), and also that I should store the most heavy and the most used structures as globals (although I'm usually strongly against global variables in any circumstance). + +Then one bad thing thing leads to another, and at the end of the day, I was writing important literals like the number of rows and columns inline so that changing even this minor aspect now is a headache :) + +I'd rather not comment about the currently impossibility of writing unit tests for this. + +I'm sorry for that. It was nonetheless a fun day coding it, the game **works** on the Pokitto (and on the [emulator](https://github.com/felipemanga/PokittoEmu) as well) and I finally can play it anywhere. \ No newline at end of file diff --git a/assets.h b/assets.h new file mode 100644 index 0000000..044c21d --- /dev/null +++ b/assets.h @@ -0,0 +1,181 @@ +#ifndef ASSETS_H +#define ASSETS_H + +#include + +static const uint16_t game_palette[] = { + 0x18c3, 0xea06, 0x88a1, 0xf3a6, + 0x91c1, 0xffb3, 0x9440, 0x7e08, + 0x4b84, 0x0499, 0x0352, 0xce59, + 0x7bcf, 0x4a69, 0x80e7, 0x29aa, +}; + +static const uint8_t sprite_piece1[] = { + 8,8, + 0x01,0x11,0x11,0x00, + 0x11,0x11,0x11,0x10, + 0x11,0x21,0x21,0x12, + 0x12,0x22,0x22,0x12, + 0x11,0x22,0x21,0x12, + 0x11,0x12,0x11,0x12, + 0x01,0x11,0x11,0x22, + 0x00,0x22,0x22,0x20, +}; + +static const uint8_t sprite_piece2[] = { + 8,8, + 0x03,0x33,0x33,0x00, + 0x33,0x33,0x33,0x30, + 0x33,0x44,0x43,0x34, + 0x34,0x43,0x44,0x34, + 0x33,0x44,0x43,0x34, + 0x33,0x33,0x33,0x34, + 0x03,0x33,0x33,0x44, + 0x00,0x44,0x44,0x40, +}; + +static const uint8_t sprite_piece3[] = { + 8,8, + 0x05,0x55,0x55,0x00, + 0x55,0x55,0x55,0x50, + 0x55,0x65,0x65,0x56, + 0x55,0x55,0x55,0x56, + 0x56,0x66,0x66,0x56, + 0x55,0x66,0x65,0x56, + 0x05,0x55,0x55,0x66, + 0x00,0x66,0x66,0x60, +}; + +static const uint8_t sprite_piece4[] = { + 8,8, + 0x07,0x77,0x77,0x00, + 0x77,0x28,0x87,0x70, + 0x78,0x88,0x88,0x78, + 0x78,0x88,0x82,0x78, + 0x77,0x78,0x77,0x78, + 0x77,0x78,0x77,0x78, + 0x07,0x77,0x77,0x88, + 0x00,0x88,0x88,0x80, +}; + +static const uint8_t sprite_piece5[] = { + 8,8, + 0x09,0x99,0x99,0x00, + 0x99,0x9b,0x99,0x90, + 0x99,0xba,0xa9,0x9a, + 0x9a,0xaa,0xaa,0x9a, + 0x99,0xaa,0xa9,0x9a, + 0x99,0x9a,0x99,0x9a, + 0x09,0x99,0x99,0xaa, + 0x00,0xaa,0xaa,0xa0, +}; + +static const uint8_t sprite_pieceQ[] = { + 8,8, + 0x0b,0xbb,0xbb,0x00, + 0xbb,0xcc,0xcb,0xb0, + 0xbb,0xbb,0xcb,0xbc, + 0xbb,0xbc,0xcb,0xbc, + 0xbb,0xbb,0xbb,0xbc, + 0xbb,0xbc,0xbb,0xbc, + 0x0b,0xbb,0xbb,0xcc, + 0x00,0xcc,0xcc,0xc0, +}; + +static const uint8_t sprite_combo[] = { + 8,8, + 0x01,0x11,0x11,0x00, + 0x12,0x22,0x22,0x10, + 0x12,0x01,0x00,0x12, + 0x12,0x11,0x10,0x12, + 0x12,0x01,0x22,0x12, + 0x12,0x00,0x20,0x12, + 0x01,0x11,0x11,0x22, + 0x00,0x22,0x22,0x20, +}; + +static const uint8_t sprite_bomb1[] = { + 8,8, + 0x00,0xbb,0xb0,0x00, + 0x0b,0xbb,0xbb,0x00, + 0xbb,0x1b,0x1b,0xb0, + 0xb1,0x11,0x11,0xbc, + 0xbb,0x11,0x1b,0xbc, + 0x0b,0xb1,0xbb,0xcc, + 0x00,0xbb,0xbc,0xc0, + 0x00,0x0c,0xcc,0x00, +}; + +static const uint8_t sprite_bomb2[] = { + 8,8, + 0x00,0xbb,0xb0,0x00, + 0x0b,0xbb,0xbb,0x00, + 0xbb,0x33,0x3b,0xb0, + 0xb3,0x3b,0x33,0xbc, + 0xbb,0x33,0x3b,0xbc, + 0x0b,0xbb,0xbb,0xcc, + 0x00,0xbb,0xbc,0xc0, + 0x00,0x0c,0xcc,0x00, +}; + +static const uint8_t sprite_bomb3[] = { + 8,8, + 0x00,0xbb,0xb0,0x00, + 0x0b,0xbb,0xbb,0x00, + 0xbb,0x5b,0x5b,0xb0, + 0xbb,0xbb,0xbb,0xbc, + 0xb5,0x55,0x55,0xbc, + 0x0b,0x55,0x5b,0xcc, + 0x00,0xbb,0xbc,0xc0, + 0x00,0x0c,0xcc,0x00, +}; + +static const uint8_t sprite_bomb4[] = { + 8,8, + 0x00,0xbb,0xb0,0x00, + 0x0b,0x18,0x8b,0x00, + 0xb8,0x88,0x88,0xb0, + 0xb8,0x88,0x81,0xbc, + 0xbb,0xb8,0xbb,0xbc, + 0x0b,0xb8,0xbb,0xcc, + 0x00,0xbb,0xbc,0xc0, + 0x00,0x0c,0xcc,0x00, +}; + +static const uint8_t sprite_bomb5[] = { + 8,8, + 0x00,0xbb,0xb0,0x00, + 0x0b,0xb9,0xbb,0x00, + 0xbb,0x99,0x9b,0xb0, + 0xb9,0x9b,0x99,0xbc, + 0xbb,0x99,0x9b,0xbc, + 0x0b,0xb9,0xbb,0xcc, + 0x00,0xbb,0xbc,0xc0, + 0x00,0x0c,0xcc,0x00, +}; + +static const uint8_t sprite_marked[] = { + 8,8, + 0x01,0x11,0x11,0x00, + 0x12,0x22,0x22,0x10, + 0x12,0x00,0x00,0x12, + 0x12,0x00,0x00,0x12, + 0x12,0x00,0x00,0x12, + 0x12,0x00,0x00,0x12, + 0x01,0x11,0x11,0x22, + 0x00,0x22,0x22,0x20, +}; + +static const uint8_t sprite_grabber[] = { + 16,8, + 0x00,0x00,0xfb,0xff,0xff,0xbf,0x00,0x00, + 0x00,0x00,0xdb,0xbc,0xcb,0xbd,0x00,0x00, + 0x70,0x00,0xfd,0xc9,0x9c,0xdf,0x00,0x01, + 0x86,0x00,0xff,0xda,0xad,0xff,0x00,0x32, + 0xc6,0xc0,0xfc,0xbd,0xdb,0xcf,0x0c,0x4c, + 0x0c,0xdb,0xbb,0xbb,0xbb,0xbb,0xbd,0xc0, + 0x0d,0xdc,0xbb,0x42,0x86,0xbb,0xcd,0xd0, + 0x00,0xdd,0xdd,0xff,0xff,0xdd,0xdd,0x00, +}; + +#endif \ No newline at end of file diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..053c77c --- /dev/null +++ b/main.cpp @@ -0,0 +1,546 @@ +#include +#include "Pokitto.h" +#include "assets.h" + +// Display size: 110x88 + +// In the board, each cell has one byte with this +// representation (from least to most significant) +// 3 bits = color +// 1 bit = is bomb +// 2 bits = DFS visited status (alternate bits to fast clear) +// 1 bit = is giving combo score +// 1 bit = is locked due to matching + +// TRouBLe (255 = -1 for uint8_t) +const uint8_t directions[4][2] = { + {255, 0}, {0, 1}, {1, 0}, {0, 255} +}; + +const uint8_t mask_reset_v1 = 0b11101111; +const uint8_t mask_gset_v1 = 0b00010000; + +const uint8_t mask_reset_v2 = 0b11011111; +const uint8_t mask_gset_v2 = 0b00100000; + +const uint8_t mask_gset_lock = 0b10000000; +const uint8_t mask_gset_bonus = 0b01000000; + + +const uint8_t *sprites_pieces[] = { + sprite_piece1, + sprite_piece2, + sprite_piece3, + sprite_piece4, + sprite_piece5, + sprite_pieceQ, +}; + +const uint8_t *sprites_bombs[] = { + sprite_bomb1, + sprite_bomb2, + sprite_bomb3, + sprite_bomb4, + sprite_bomb5, +}; + +const uint8_t *sprites_lock[] = { + sprite_marked, + sprite_combo, +}; + +Pokitto::Core pokitto; +uint8_t _board[77]; +uint8_t *rows[11]; + +uint8_t restart_delay_value = 10; +uint8_t restart_freeze_value = 30; +uint8_t frozen = 0; +const uint8_t initial_delay = 20; +uint8_t remaining_delay = 20; +uint8_t remaining_shift = 8; + +uint8_t column_first_hole[7]; +uint8_t column_height[7]; +uint8_t hold = 0; +uint8_t robot_at = 3; +uint8_t paused = 0; +uint8_t gameover = 0; +uint8_t mainmenu = 1; + +int score = 0; +int highscore = 0; + +struct BtnHelder { + uint8_t frames; + uint8_t button; + + BtnHelder(uint8_t button) { + this->button = button; + } + + bool operator()() { + if (pokitto.buttons.repeat(button, 1)) { + frames ++; + return frames == 1 || frames == 6 || (frames >= 9 && frames & 1); + } else { + frames = 0; + return false; + } + } +}; + +BtnHelder btnHelderLeft(BTN_LEFT); +BtnHelder btnHelderRight(BTN_RIGHT); + +void drawPiece(uint8_t x, uint8_t y, uint8_t piece_type, const uint8_t * bitmap) { + uint8_t c[4] = {0, 0, 0, 11}; + const uint8_t * p = &bitmap[2]; + c[1] = (piece_type << 1) + 1; + c[2] = c[1] + 1; + uint8_t col; + for (uint8_t i = 0; i < (uint8_t) 8; i++, y++) { + for (uint8_t j = 0; j < (uint8_t) 4; j++, x++, p++) { + if ((col = c[(*p) >> 4])) + pokitto.display.drawPixel((int16_t) x, (int16_t) y, col); + x++; + if ((col = c[(*p) & 0xf])) + pokitto.display.drawPixel((int16_t) x, (int16_t) y, col); + } + x -= (uint8_t) 8; + } +} + +void drawPiece(uint8_t x, uint8_t y, const uint8_t * bitmap) { + const uint8_t * p = &bitmap[2]; + uint8_t col; + for (uint8_t i = 0; i < (uint8_t) 8; i++, y++) { + for (uint8_t j = 0; j < (uint8_t) 4; j++, x++, p++) { + if ((col = (*p) >> 4)) + pokitto.display.drawPixel((int16_t) x, (int16_t) y, col); + x++; + if ((col = (*p) & 0xf)) + pokitto.display.drawPixel((int16_t) x, (int16_t) y, col); + } + x -= (uint8_t) 8; + } +} + +void config() { + pokitto.begin(); + pokitto.setFrameRate(30); + srand(pokitto.getTime()); + pokitto.display.load565Palette(game_palette); + pokitto.display.bgcolor = 0; + pokitto.display.setFont(font3x5); + for (int i = 0; i < 11; i += 1) { + rows[i] = &_board[7 * i]; + } +} + +void resetVisitedWDFS(uint8_t i, uint8_t j, uint8_t col) { + rows[i][j] = (rows[i][j] & mask_reset_v1) | mask_gset_v2; + for (uint8_t d = 0; d < 4; d++) { + uint8_t ii = i + directions[d][0]; + uint8_t jj = j + directions[d][1]; + if (ii != 255 && jj != 255 && ii != 11 && jj != 7 + && (rows[ii][jj] & 0xf) == col + && !(rows[ii][jj] & mask_gset_v2)) { + resetVisitedWDFS(ii, jj, col); + } + } +} + +uint8_t _countConnEq(uint8_t i, uint8_t j, uint8_t col) { + uint8_t conn = 1; + rows[i][j] = (rows[i][j] & mask_reset_v2) | mask_gset_v1; + for (uint8_t d = 0; d < 4; d++) { + uint8_t ii = i + directions[d][0]; + uint8_t jj = j + directions[d][1]; + if (ii != 255 && jj != 255 && ii != 11 && jj != 7 + && (rows[ii][jj] & 0xf) == col + && !(rows[ii][jj] & mask_gset_v1)) { + conn += _countConnEq(ii, jj, col); + } + } + return conn; +} + +uint8_t countConnEq(uint8_t i, uint8_t j, uint8_t col) { + uint8_t ret = _countConnEq(i, j, col); + resetVisitedWDFS(i, j, col); + return ret; +} + +uint8_t lockPieces(uint8_t i, uint8_t j, uint8_t col, uint8_t acc = 0) { + acc++; + rows[i][j] |= mask_gset_lock; + if (acc > 4) { + rows[i][j] |= mask_gset_bonus; + } + for (uint8_t d = 0; d < 4; d++) { + uint8_t ii = i + directions[d][0]; + uint8_t jj = j + directions[d][1]; + if (ii != 255 && jj != 255 && ii != 11 && jj != 7 + && (rows[ii][jj] & 0xf) == col + && !(rows[ii][jj] & mask_gset_lock)) { + acc = lockPieces(ii, jj, col, acc); + } + } + return acc; +} + +void tryEarnAt(uint8_t i, uint8_t j) { + uint8_t val = rows[i][j]; + if (val & 0b1000) { + if (countConnEq(i, j, val & 0xf) > 1) { + lockPieces(i, j, val & 0xf, 0); + uint8_t typ = val & 0b0111; + for (int it = 0; it < 77; it++) { + if ((_board[it] & 0xf) == typ) { + _board[it] |= mask_gset_lock; + } + } + if (!frozen) { + frozen = 1; + remaining_delay = restart_freeze_value; + } + } + } else { + if (countConnEq(i, j, val & 0xf) >= 4) { + if (!frozen) { + frozen = 1; + remaining_delay = restart_freeze_value; + lockPieces(i, j, val & 0xf, 0); + } else { + lockPieces(i, j, val & 0xf, 4); + } + } + } +} + +template void shuffle (T* v, uint8_t n) { + for (int i = n - 1; i; i--) { + int j = random(0, i + 1); + std::swap(v[i], v[j]); + } +} + +bool _generateRow(uint8_t cur = 0) { + if (cur == 7) { + return true; + } + uint8_t tries[5] = {1, 2, 3, 4, 5}; + shuffle(tries, 5); + for (int t = 0; t < 5; t++) { + rows[0][cur] = tries[t]; + if (countConnEq(0, cur, tries[t]) < 4) { + if (_generateRow(cur + 1)) { + return true; + } + } + } + rows[0][cur] = 0; + return false; +} + +void generateRow() { + for (int i = 0; i < 7; i++) { + rows[0][i] = 0; + } + _generateRow(); +} + +void generateBomb() { + if (random(0, 3) == 0) { + int j = random(0, 7); + if (countConnEq(0, j, rows[0][j] | 0b1000) == 1) { + rows[0][j] |= 0b1000; + } + } +} + +void drawPlayer() { + pokitto.display.setColor(14); + pokitto.display.fillRectangle(0, 79, 110, 0); + + pokitto.display.setColor(15); + pokitto.display.fillRectangle(10 + 8 * robot_at, 0, 8, 88); + + pokitto.display.drawBitmap(6 + 8 * robot_at, 80, sprite_grabber); + + if (hold) { + if (hold & 0b1000) { + drawPiece(10 + 8 * robot_at, 83, sprites_bombs[(hold & 0b111) - 1]); + } else { + drawPiece(10 + 8 * robot_at, 83, sprites_pieces[(hold & 0b111) - 1]); + } + } +} + +void drawBoard() { + for (int col = 0; col < 7; col++) { + for (int row = 0; row < 11; row++) { + uint8_t val = rows[row][col]; + if (val) { + if (paused) val = 6; + if (val & mask_gset_lock) { + drawPiece(10 + 8 * col, row * 8 - remaining_shift - 8, (val & 0b111) - 1, sprites_lock[(val >> 6) & 1]); + } else if (val & 0b1000) { + drawPiece(10 + 8 * col, row * 8 - remaining_shift - 8, sprites_bombs[(val & 0b111) - 1]); + } else { + drawPiece(10 + 8 * col, row * 8 - remaining_shift - 8, sprites_pieces[(val & 0b111) - 1]); + } + } + } + } +} + +void rotateRows() { + for (int i = 10; i; i--) { + std::swap(rows[i], rows[i - 1]); + } +} + +void restartBoard() { + for (int i = 0; i < 11*7; i++) { + _board[i] = 0; + } + for (int i = 0; i < 4; i++) { + rotateRows(); + generateRow(); + } + robot_at = 3; + hold = 0; + score = 0; + remaining_delay = initial_delay; + remaining_shift = 8; + gameover = 0; + paused = 0; + mainmenu = 0; +} + +void checkInput() { + if (gameover) { + if (pokitto.buttons.pressed(BTN_C)) { + highscore = max(score, highscore); + mainmenu = 1; + } + return; + } else if (paused) { + if (pokitto.buttons.pressed(BTN_C)) { + paused = 0; + } + return; + } + if (btnHelderRight() && robot_at != 6) { + robot_at++; + } + if (btnHelderLeft() && robot_at != 0) { + robot_at--; + } + if (pokitto.buttons.pressed(BTN_B)) { + int i; + for (i = 10; i && rows[i][robot_at] == 0; i--); + if (i && !(rows[i][robot_at] & mask_gset_lock) + && !(rows[i - 1][robot_at] & mask_gset_lock)) { + std::swap(rows[i][robot_at], rows[i - 1][robot_at]); + tryEarnAt(i - 1, robot_at); + tryEarnAt(i, robot_at); + } + } else if (pokitto.buttons.pressed(BTN_A)) { + uint8_t i; + for (i = 10; i != 255 && rows[i][robot_at] == 0; i--); + if (hold) { + i++; + if (i != 11) { + rows[i][robot_at] = hold; + hold = 0; + tryEarnAt(i, robot_at); + } + } else { + if (i != 255 && !(rows[i][robot_at] & mask_gset_lock)) { + hold = rows[i][robot_at]; + rows[i][robot_at] = 0; + } + } + } else if (pokitto.buttons.pressed(BTN_C)) { + paused = 1; + } +} + +void compactBoard() { + for (int j = 0; j < 7; j++) { + column_first_hole[j] = 11; + for (int i = 0; i < 11; i++) { + if (rows[i][j] == 0) { + column_first_hole[j] = i; + break; + } + } + column_height[j] = column_first_hole[j]; + + for (int i = column_height[j]; i < 11; i++) { + if (rows[i][j] != 0) { + rows[column_height[j]][j] = rows[i][j]; + column_height[j]++; + rows[i][j] = 0; + } + } + } +} + +void finishFrozen() { + for (int i = 0; i < 77; i++) { + if (_board[i] >> 7) { + score += 10 + ((_board[i] & mask_gset_bonus) ? 10 : 0); + _board[i] = 0; + } + } + + compactBoard(); + for (int j = 0; j < 7; j++) { + for (int i = column_first_hole[j]; i < column_height[j]; i++) { + if (!(rows[i][j] & 0b1000) && !(rows[i][j] >> 6)) { + tryEarnAt(i, j); + } + } + } + + for (int j = 0; j < 7; j++) { + for (int i = column_first_hole[j]; i < column_height[j]; i++) { + if ((rows[i][j] & 0b1000) && !(rows[i][j] >> 6)) { + tryEarnAt(i, j); + } + } + } + + bool keepFrozen = false; + for (int i = 0; i < 77; i++) { + if (_board[i] >> 7) { + keepFrozen = true; + break; + } + } + + if (keepFrozen) { + remaining_delay = restart_freeze_value; + } else { + remaining_delay = restart_delay_value; + frozen = 0; + } + + // highscore = max(score, highscore); +} + +bool checkGameOver() { + for (int j = 0; j < 7; j++) { + if (rows[10][j]) return true; + } + return false; +} + +void ingame() { + checkInput(); + + if (!gameover && !paused) { + remaining_delay--; + } + if (!remaining_delay && !frozen) { + remaining_delay = restart_delay_value; + remaining_shift--; + } else if(!remaining_delay && frozen) { + finishFrozen(); + } + if (!remaining_shift) { + if (checkGameOver()) { + gameover = 1; + } else { + remaining_shift = 8; + rotateRows(); + generateRow(); + generateBomb(); + } + } + + pokitto.display.setColor(1); + pokitto.display.setCursor(76, 10); + pokitto.display.print("Score:"); + pokitto.display.setCursor(76, 18); + pokitto.display.print(score); + pokitto.display.setColor(3); + pokitto.display.setCursor(76, 26); + pokitto.display.print("HScore:"); + pokitto.display.setCursor(76, 34); + pokitto.display.print(highscore); + pokitto.display.setCursor(76, 44); + + if (!paused && !gameover) { + drawPlayer(); + } else if(gameover) { + pokitto.display.setColor(1); + pokitto.display.setCursor(0, 82); + pokitto.display.print(" GAME OVER (PRESS C)"); + } else { + pokitto.display.setColor(5); + pokitto.display.setCursor(0, 82); + pokitto.display.print(" PAUSED (PRESS C)"); + } + drawBoard(); +} + +char str_highscore[10]; +void inmainmenu() { + pokitto.display.setFont(fontAdventurer); + pokitto.display.setColor(1); + pokitto.display.setCursor(30, 10); + pokitto.display.print("Raquer"); + pokitto.display.setCursor(45, 30); + pokitto.display.print("Mete"); + pokitto.display.setColor(5); + pokitto.display.setCursor(32, 32); + pokitto.display.print("*"); + + pokitto.display.setFont(fontKoubit); + pokitto.display.setCursor(25, 50); + pokitto.display.setColor(3); + pokitto.display.print("High score"); + pokitto.display.setFont(fontDonut); + pokitto.display.setColor(5); + pokitto.display.setCursor(22, 58); + sprintf(str_highscore, "%9d", highscore); + for (int i = 0; str_highscore[i]; i++) { + if (str_highscore[i] == ' ') str_highscore[i] = '-'; + } + pokitto.display.print(str_highscore); + + pokitto.display.setFont(font3x5); + pokitto.display.setColor(11); + pokitto.display.setCursor(25, 82); + pokitto.display.write("PRESS TO PLAY"); + pokitto.display.setColor(7); + pokitto.display.setCursor(49, 82); + pokitto.display.write("C"); + + if (pokitto.buttons.pressed(BTN_C)) { + restartBoard(); + } +} + +int main() { + config(); + + while (pokitto.isRunning()) { + if (pokitto.update()) { + pokitto.display.clear(); + + if (mainmenu) { + inmainmenu(); + } else { + ingame(); + } + } + } + + return 0; +} \ No newline at end of file diff --git a/mbed_config.h b/mbed_config.h new file mode 100644 index 0000000..0a9721f --- /dev/null +++ b/mbed_config.h @@ -0,0 +1 @@ +// Nothing to see here \ No newline at end of file diff --git a/raquer.bin b/raquer.bin new file mode 100644 index 0000000..aed9be7 Binary files /dev/null and b/raquer.bin differ