Matrix: ab und zu fällt ein roter Pixel
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e2fc97fc68
commit
bcb33c1dd1
2 files changed
+11
-5
No files matched your search
@@ -124,7 +124,7 @@ Nach dem Einschalten läuft das Gewitter.
|
|||||||
| | Effekt | `id` | Dauer | Beschreibung |
|
| | Effekt | `id` | Dauer | Beschreibung |
|
||||||
| --- | --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| 🧊 | Würfel im Würfel | `wuerfel` | 20 s | Pulse laufen als Würfelschalen von der Mitte zur Außenhaut |
|
| 🧊 | Würfel im Würfel | `wuerfel` | 20 s | Pulse laufen als Würfelschalen von der Mitte zur Außenhaut |
|
||||||
| 🟩 | Matrix | `matrix` | 20 s | Grüne Zeichenketten rieseln herab |
|
| 🟩 | Matrix | `matrix` | 20 s | Grüne Zeichenketten rieseln herab, ab und zu fällt ein roter Pixel |
|
||||||
| 🏀 | Flummis | `flummis` | 20 s | Zwei Bälle springen durch den Würfel |
|
| 🏀 | Flummis | `flummis` | 20 s | Zwei Bälle springen durch den Würfel |
|
||||||
| 📸 | Blitzlicht | `blitzlicht` | 15 s | Würfel, Etage oder Ebene blitzt in wechselnden Farben (höchstens 2,5 Blitze/s) |
|
| 📸 | Blitzlicht | `blitzlicht` | 15 s | Würfel, Etage oder Ebene blitzt in wechselnden Farben (höchstens 2,5 Blitze/s) |
|
||||||
| 📡 | Scanner | `scanner` | 20 s | Eine Ebene fegt hin und her, jedes Mal entlang einer anderen Achse |
|
| 📡 | Scanner | `scanner` | 20 s | Eine Ebene fegt hin und her, jedes Mal entlang einer anderen Achse |
|
||||||
|
|||||||
+10
-4
@@ -295,19 +295,25 @@ void renderFireworks(uint32_t now) {
|
|||||||
drawParticles();
|
drawParticles();
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Matrix: grüne Zeichenketten rieseln herab --------------------------------
|
// --- Matrix: grüne Zeichenketten rieseln herab, ab und zu ein roter Pixel -------
|
||||||
|
|
||||||
void renderMatrix(uint32_t now) {
|
void renderMatrix(uint32_t now) {
|
||||||
FastLED.clear();
|
FastLED.clear();
|
||||||
if (random8() < 40)
|
if (random8() < 40) {
|
||||||
spawnParticle(random8(CUBE_SIZE), random8(CUBE_SIZE), TOP, 0, 0, -rnd(0.06f, 0.15f), CRGB::Black);
|
bool red = random8(20) == 0; // etwa alle 2-3 s
|
||||||
|
spawnParticle(random8(CUBE_SIZE), random8(CUBE_SIZE), TOP, 0, 0, -rnd(0.06f, 0.15f), red ? CRGB::Red : CRGB::Black);
|
||||||
|
}
|
||||||
moveParticles(0, 1, 0);
|
moveParticles(0, 1, 0);
|
||||||
for (const Particle &p : particles) {
|
for (const Particle &p : particles) {
|
||||||
if (!p.life) continue;
|
if (!p.life || p.color.r) continue;
|
||||||
plot(p.x, p.y, p.z + 2, CRGB(0, brightness / 4, 0));
|
plot(p.x, p.y, p.z + 2, CRGB(0, brightness / 4, 0));
|
||||||
plot(p.x, p.y, p.z + 1, CRGB(0, brightness, 0));
|
plot(p.x, p.y, p.z + 1, CRGB(0, brightness, 0));
|
||||||
plot(p.x, p.y, p.z, CRGB(highlight / 2, highlight, highlight / 2));
|
plot(p.x, p.y, p.z, CRGB(highlight / 2, highlight, highlight / 2));
|
||||||
}
|
}
|
||||||
|
for (const Particle &p : particles) { // rote Pixel zuletzt und ohne Mischen, damit sie rein rot bleiben
|
||||||
|
int x = lroundf(p.x), y = lroundf(p.y), z = lroundf(p.z);
|
||||||
|
if (p.life && p.color.r && inCube(x, y, z)) at(x, y, z) = CRGB(highlight, 0, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Schnee: Flocken taumeln herab und bleiben unten kurz liegen ---------------
|
// --- Schnee: Flocken taumeln herab und bleiben unten kurz liegen ---------------
|
||||||
|
|||||||
Reference in new issue
Block a user