-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from flame-engine/luan.glb
Upgrade to use new flame_3d version
- Loading branch information
Showing
27 changed files
with
187 additions
and
473 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
include: package:flutter_lints/flutter.yaml | ||
include: package:flame_lint/analysis_options.yaml |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,44 @@ | ||
import 'package:defend_the_donut/utils.dart'; | ||
import 'package:flame_audio/flame_audio.dart'; | ||
|
||
class Audio { | ||
static late final AudioPool _pewPool; | ||
static late final AudioPool _failedPewPool; | ||
|
||
static Future<void> init() async { | ||
_pewPool = await FlameAudio.createPool('sfx/laser.mp3', maxPlayers: 5, minPlayers: 3); | ||
_failedPewPool = await FlameAudio.createPool('sfx/error.mp3', maxPlayers: 5, minPlayers: 3); | ||
_pewPool = await FlameAudio.createPool( | ||
'sfx/laser.mp3', | ||
maxPlayers: 5, | ||
minPlayers: 3, | ||
); | ||
_failedPewPool = await FlameAudio.createPool( | ||
'sfx/error.mp3', | ||
maxPlayers: 5, | ||
minPlayers: 3, | ||
); | ||
} | ||
|
||
static void pew() { | ||
_pewPool.start(); | ||
if (enableAudio) { | ||
_pewPool.start(); | ||
} | ||
} | ||
|
||
static void failedPew() { | ||
_failedPewPool.start(); | ||
if (enableAudio) { | ||
_failedPewPool.start(); | ||
} | ||
} | ||
|
||
static void boost() { | ||
FlameAudio.play('sfx/boost.mp3'); | ||
if (enableAudio) { | ||
FlameAudio.play('sfx/boost.mp3'); | ||
} | ||
} | ||
|
||
static void explode() { | ||
FlameAudio.play('sfx/explode.mp3'); | ||
if (enableAudio) { | ||
FlameAudio.play('sfx/explode.mp3'); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.