update method

  1. @override
void update()
override

Implementation

@override
void update() {
  if (!hasBurst) {
    // Rocket moves upwards
    y -= speed;

    // Check if it's time to burst
    if (y <= position.dy) {
      burst();
    }
  } else {
    // Update burst particles
    for (var particle in burstParticles) {
      particle.update();
    }
  }
}