SceneLevel constructor

SceneLevel({
  1. required Game game,
  2. required Message message,
  3. required void onDone(),
  4. int? duration,
  5. ScanCode? skipScanCode,
  6. GameControllerButton? skipControllerButton,
  7. SoundChannel? soundChannel,
  8. AssetReference? music,
  9. List<Ambiance>? ambiances,
  10. List<RandomSound>? randomSounds,
  11. Map<String, Command>? commands,
})

Create an instance.

Both ambiances and randomSounds will be passed to the Level constructor.

Implementation

SceneLevel({
  required super.game,
  required this.message,
  required this.onDone,
  this.duration,
  this.skipScanCode,
  this.skipControllerButton,
  this.soundChannel,
  super.music,
  super.ambiances,
  super.randomSounds,
  super.commands,
})  : assert(
        duration != null ||
            skipControllerButton != null ||
            skipScanCode != null,
        'At least one of `duration`, `skipControllerButton`, or '
        '`skipScanCode` must not be null.',
      ),
      assert(
        message.keepAlive == true,
        'If `keepAlive` is not `true`, then `onPop` will not function '
        'properly.',
      );