mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-01 19:12:31 +08:00
Add flame_lint to examples (#1090)
This commit is contained in:
@ -428,21 +428,23 @@ class ParticlesGame extends FlameGame with FPSCounter {
|
||||
return AcceleratedParticle(
|
||||
speed: initialSpeed,
|
||||
acceleration: deceleration + gravity,
|
||||
child: ComputedParticle(renderer: (canvas, particle) {
|
||||
final paint = randomElement(paints);
|
||||
// Override the color to dynamically update opacity
|
||||
paint.color = paint.color.withOpacity(1 - particle.progress);
|
||||
child: ComputedParticle(
|
||||
renderer: (canvas, particle) {
|
||||
final paint = randomElement(paints);
|
||||
// Override the color to dynamically update opacity
|
||||
paint.color = paint.color.withOpacity(1 - particle.progress);
|
||||
|
||||
canvas.drawCircle(
|
||||
Offset.zero,
|
||||
// Closer to the end of lifespan particles
|
||||
// will turn into larger glaring circles
|
||||
rnd.nextDouble() * particle.progress > .6
|
||||
? rnd.nextDouble() * (50 * particle.progress)
|
||||
: 2 + (3 * particle.progress),
|
||||
paint,
|
||||
);
|
||||
}),
|
||||
canvas.drawCircle(
|
||||
Offset.zero,
|
||||
// Closer to the end of lifespan particles
|
||||
// will turn into larger glaring circles
|
||||
rnd.nextDouble() * particle.progress > .6
|
||||
? rnd.nextDouble() * (50 * particle.progress)
|
||||
: 2 + (3 * particle.progress),
|
||||
paint,
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user