update method
Implementation
void update(Size bounds) {
// Update the position by adding the velocity.
position += velocity;
// If the particle was accelerated, gradually reduce its velocity to the default.
if (wasAccelerated) {
_updateAcceleratedVelocity();
}
// Handle collisions with the screen boundaries.
handleScreenBoundaries(bounds);
// Update the visibility status of the particle.
updateVisibility(bounds);
}