Game constructor
Game({
- required String title,
- required Sdl sdl,
- required SoundBackend soundBackend,
- String orgName = 'com.example',
- String appName = 'untitled_game',
- String preferencesFileName = 'preferences.json',
- String preferencesKey = defaultPreferencesKey,
- TriggerMap triggerMap = const TriggerMap([]),
- Random? random,
Create an instance.
Implementation
Game({
required this.title,
required this.sdl,
required this.soundBackend,
this.orgName = 'com.example',
this.appName = 'untitled_game',
this.preferencesFileName = 'preferences.json',
this.preferencesKey = defaultPreferencesKey,
this.triggerMap = const TriggerMap([]),
final Random? random,
}) : _levels = [],
_isRunning = false,
tasks = [],
gameControllers = {},
joysticks = {},
random = random ?? Random(),
interfaceSounds = soundBackend.createSoundChannel(),
ambianceSounds = soundBackend.createSoundChannel(),
musicSounds = soundBackend.createSoundChannel();