Compare commits
No commits in common. "4f9fe2a24dd66c11422535d66bce104a32efe7a6" and "6b4ed1658c2086e51bf085b0a272e6bf2cd87bfb" have entirely different histories.
4f9fe2a24d
...
6b4ed1658c
@ -190,46 +190,23 @@ public:
|
||||
return countof(sym[0]);
|
||||
}
|
||||
|
||||
static bool doCreeperBlink() {
|
||||
const auto now = millis();
|
||||
static auto blink = false;
|
||||
static auto last = now;
|
||||
if (!blink) {
|
||||
if (now - last >= 3000) {
|
||||
last = now;
|
||||
if (random(3) == 0) {
|
||||
blink = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (now - last >= 500) {
|
||||
last = now;
|
||||
blink = false;
|
||||
}
|
||||
}
|
||||
return blink;
|
||||
}
|
||||
|
||||
// TODO REMOVE QUICK & DIRTY
|
||||
uint8_t printCreeper(uint8_t xPos, uint8_t yPos) {
|
||||
const auto creeperBlink = doCreeperBlink();
|
||||
bool sym[8][8] = {
|
||||
{X, X, X, X, X, X, X, X},
|
||||
{X, X, X, X, X, X, X, X},
|
||||
{X, _, _, X, X, _, _, X},
|
||||
{X, _, _, X, X, _, _, X},
|
||||
{X, X, X, _, _, X, X, X},
|
||||
{X, X, _, _, _, _, X, X},
|
||||
{X, X, _, _, _, _, X, X},
|
||||
{X, X, _, X, X, _, X, X},
|
||||
Color G = GREEN;
|
||||
Color I = {128, 255, 128};
|
||||
Color O = BLACK;
|
||||
Color sym[7][7] = {
|
||||
{G, G, G, G, G, G, G},
|
||||
{G, I, I, I, I, I, G},
|
||||
{G, I, O, I, O, I, G},
|
||||
{G, I, I, I, I, I, G},
|
||||
{G, I, O, O, O, I, G},
|
||||
{G, I, O, I, O, I, G},
|
||||
{G, G, G, G, G, G, G},
|
||||
};
|
||||
for (int y = 0; y < countof(sym); ++y) {
|
||||
for (int x = 0; x < countof(sym[0]); ++x) {
|
||||
if (creeperBlink && ((x == 1 || x == 2) && y == 2)) {
|
||||
set(xPos + x, yPos + y, GREEN);
|
||||
} else {
|
||||
set(xPos + x, yPos + y, sym[y][x] ? GREEN : BLACK);
|
||||
}
|
||||
set(xPos + x, yPos + y, sym[y][x]);
|
||||
}
|
||||
}
|
||||
return countof(sym[0]);
|
||||
|
||||
@ -277,9 +277,9 @@ private:
|
||||
x += display.printI(x, 1, WHITE);
|
||||
x += 1;
|
||||
x += display.print(x, 1,SYMBOL_L, WHITE, true);
|
||||
x += 3;
|
||||
x += 4;
|
||||
x += display.print(x, 1, 5, WHITE, true);
|
||||
x += 3;
|
||||
x += 2;
|
||||
display.printCreeper(x, 0);
|
||||
} else {
|
||||
uint8_t x = 8;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user