@@ -9308,7 +9308,7 @@ uint16_t mode_particleFireworks1D(void) {
9308
9308
uint8_t *forcecounter;
9309
9309
9310
9310
if (SEGMENT.call == 0) { // initialization
9311
- if (!initParticleSystem1D(PartSys, 4, 150, 4, true)) // init
9311
+ if (!initParticleSystem1D(PartSys, 4, 150, 4, true)) // init advanced particle system
9312
9312
return mode_static(); // allocation failed or is single pixel
9313
9313
PartSys->setKillOutOfBounds(true);
9314
9314
PartSys->sources[0].sourceFlags.custom1 = 1; // set rocket state to standby
@@ -9324,11 +9324,8 @@ uint16_t mode_particleFireworks1D(void) {
9324
9324
PartSys->setParticleSize(SEGMENT.check3); // 1 or 2 pixel rendering
9325
9325
PartSys->setMotionBlur(SEGMENT.custom2); // anable motion blur
9326
9326
9327
- int32_t gravity = (1 + (SEGMENT.speed >> 3));
9328
- if (!SEGMENT.check1) // gravity enabled for sparks
9329
- PartSys->setGravity(0); // disable
9330
- else
9331
- PartSys->setGravity(gravity); // set gravity
9327
+ int32_t gravity = (1 + (SEGMENT.speed >> 3)); // gravity value used for rocket speed calculation
9328
+ PartSys->setGravity(SEGMENT.speed ? gravity : 0); // set gravity
9332
9329
9333
9330
if (PartSys->sources[0].sourceFlags.custom1 == 1) { // rocket is on standby
9334
9331
PartSys->sources[0].source.ttl--;
@@ -9343,8 +9340,8 @@ uint16_t mode_particleFireworks1D(void) {
9343
9340
PartSys->sources[0].source.hue = hw_random16();
9344
9341
PartSys->sources[0].var = 10; // emit variation
9345
9342
PartSys->sources[0].v = -10; // emit speed
9346
- PartSys->sources[0].minLife = 100 ;
9347
- PartSys->sources[0].maxLife = 300 ;
9343
+ PartSys->sources[0].minLife = 30 ;
9344
+ PartSys->sources[0].maxLife = SEGMENT.check2 ? 400 : 40 ;
9348
9345
PartSys->sources[0].source.x = 0; // start from bottom
9349
9346
uint32_t speed = sqrt((gravity * ((PartSys->maxX >> 2) + hw_random16(PartSys->maxX >> 1))) >> 4); // set speed such that rocket explods in frame
9350
9347
PartSys->sources[0].source.vx = min(speed, (uint32_t)127);
@@ -9383,11 +9380,11 @@ uint16_t mode_particleFireworks1D(void) {
9383
9380
PartSys->sources[0].maxLife = 1300;
9384
9381
PartSys->sources[0].source.ttl = 100 + hw_random16(64 - (SEGMENT.speed >> 2)); // standby time til next launch
9385
9382
PartSys->sources[0].sat = 7 + (SEGMENT.custom3 << 3); //color saturation TODO: replace saturation with something more useful?
9386
- PartSys->sources[0].size = hw_random16(64 ); // random particle size in explosion
9383
+ PartSys->sources[0].size = hw_random16(SEGMENT.intensity ); // random particle size in explosion
9387
9384
uint32_t explosionsize = 8 + (PartSys->maxXpixel >> 2) + (PartSys->sources[0].source.x >> (PS_P_RADIUS_SHIFT_1D - 1));
9388
9385
explosionsize += hw_random16((explosionsize * SEGMENT.intensity) >> 8);
9389
9386
for (uint32_t e = 0; e < explosionsize; e++) { // emit explosion particles
9390
- if (SEGMENT.check2)
9387
+ if (SEGMENT.check1) // colorful mode
9391
9388
PartSys->sources[0].source.hue = hw_random16(); //random color for each particle
9392
9389
PartSys->sprayEmit(PartSys->sources[0]); // emit a particle
9393
9390
}
@@ -9407,7 +9404,7 @@ uint16_t mode_particleFireworks1D(void) {
9407
9404
9408
9405
return FRAMETIME;
9409
9406
}
9410
- static const char _data_FX_MODE_PS_FIREWORKS1D[] PROGMEM = "PS Fireworks 1D@Gravity,Explosion,Firing side,Blur,Saturation,, Colorful,Smooth;,!;!;1;sx=150,c2=30,c3=31,o2=1";
9407
+ static const char _data_FX_MODE_PS_FIREWORKS1D[] PROGMEM = "PS Fireworks 1D@Gravity,Explosion,Firing side,Blur,Saturation,Colorful,Trail, Smooth;,!;!;1;sx=150,c2=30,c3=31,o1=1 ,o2=1";
9411
9408
9412
9409
/*
9413
9410
Particle based Sparkle effect
0 commit comments