24 lines
473 B
Dart
24 lines
473 B
Dart
import 'package:flame_audio/flame_audio.dart';
|
|
|
|
class AudioManager {
|
|
static Future<void> load() async {
|
|
await FlameAudio.audioCache.loadAll([
|
|
'select.ogg',
|
|
'four_elements.ogg',
|
|
'explosion.ogg',
|
|
]);
|
|
}
|
|
|
|
static void playSelectSound() {
|
|
FlameAudio.play('select.ogg');
|
|
}
|
|
|
|
static void playFourElementsSound() {
|
|
FlameAudio.play('four_elements.ogg');
|
|
}
|
|
|
|
static void playExplosionSound() {
|
|
FlameAudio.play('explosion.ogg');
|
|
}
|
|
}
|