You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
staticconstchar _data_FX_MODE_ROLLINGBALLS[] PROGMEM = "Rolling Balls@!,# of balls,,,,Collide,Overlay,Trails;!,!,!;!;1;m12=1"; //bar
3179
3179
#endif// WLED_PS_DONT_REPLACE_1D_FX
3180
3180
3181
+
3182
+
/*
3183
+
/ Pac-Man by Bob Loeffler with help from @dedehai and @blazoncek
3184
+
* speed slider is for speed.
3185
+
* intensity slider is for selecting the number of power dots.
3186
+
* custom1 slider is for selecting the LED where the ghosts will start blinking blue.
3187
+
* custom2 slider is for blurring the LEDs in the segment.
3188
+
* custom3 slider is for selecting the # of ghosts (between 2 and 8).
3189
+
* check1 is for displaying White Dots that PacMan eats. Enabled will show white dots. Disabled will not show any white dots (all leds will be black).
3190
+
* check2 is for Smear mode (enabled will smear/persist the LED colors, disabled will not).
3191
+
* check3 is for the Compact Dots mode of displaying white dots. Enabled will show white dots in every LED. Disabled will show black LEDs between the white dots.
3192
+
* aux0 is used to keep track of the previous number of power dots in case the user selects a different number with the intensity slider.
3193
+
* aux1 is the main counter for timing.
3194
+
*/
3195
+
typedefstructPacManChars {
3196
+
signed pos;
3197
+
signed topPos; // LED position of farthest PacMan has moved
3198
+
uint32_t color;
3199
+
bool direction; // true = moving away from first LED
3200
+
bool blue; // used for ghosts only
3201
+
bool eaten; // used for power dots only
3202
+
} pacmancharacters_t;
3203
+
3204
+
staticuint16_tmode_pacman(void) {
3205
+
constexprunsigned ORANGEYELLOW = 0xFFCC00;
3206
+
constexprunsigned PURPLEISH = 0xB000B0;
3207
+
constexprunsigned ORANGEISH = 0xFF8800;
3208
+
constexprunsigned WHITEISH = 0x999999;
3209
+
constexprunsigned PACMAN = 0; // PacMan is character[0]
character[numGhosts + 1].pos = SEGLEN - 1; // Last power dot at end
3258
+
}
3259
+
3260
+
if (strip.now > SEGENV.step) {
3261
+
SEGENV.step = strip.now;
3262
+
SEGENV.aux1++;
3263
+
}
3264
+
3265
+
// Clear background if not in smear mode
3266
+
if (!smearMode) SEGMENT.fill(BLACK);
3267
+
3268
+
// Draw white dots in front of PacMan if option selected
3269
+
if (SEGMENT.check1) {
3270
+
int step = SEGMENT.check3 ? 1 : 2; // Compact or spaced dots
3271
+
for (int i = SEGLEN - 1; i > character[PACMAN].topPos; i -= step) {
3272
+
SEGMENT.setPixelColor(i, WHITEISH);
3273
+
}
3274
+
}
3275
+
3276
+
// Update power dot positions dynamically
3277
+
uint32_t everyXLeds = (((uint32_t)SEGLEN - 10U) << 8) / numPowerDots; // Fixed-point spacing for power dots: use 32-bit math to avoid overflow on long segments.
if (character[PACMAN].topPos < character[PACMAN].pos) {
3368
+
character[PACMAN].topPos = character[PACMAN].pos;
3369
+
}
3370
+
3371
+
SEGMENT.blur(SEGMENT.custom2>>1);
3372
+
return FRAMETIME;
3373
+
}
3374
+
staticconstchar _data_FX_MODE_PACMAN[] PROGMEM = "PacMan@Speed,# of PowerDots,Blink distance,Blur,# of Ghosts,Dots,Smear,Compact;;!;1;m12=0,sx=192,ix=64,c1=64,c2=0,c3=12,o1=1,o2=0";
0 commit comments