# Description
AudioPlayers used to mix their sounds with other audio on the device,
which is not the proposed experience on Mobile devices. So this behavior
was changed in AudioPlayers, but it wasn't enforced due to a bug.
Obviously this behavior is not wanted for Games as multiple sounds
should play simultaneously, so this recovers the old functionality
again.
## Checklist
<!--
Before you create this PR confirm that it meets all requirements listed
below by checking the
relevant checkboxes with `[x]`. If some checkbox is not applicable, mark
it as `[-]`.
-->
- [x] I have followed the [Contributor Guide] when preparing my PR.
- [ ] I have updated/added tests for ALL new/updated/fixed
functionality.
- [ ] I have updated/added relevant documentation in `docs` and added
dartdoc comments with `///`.
- [x] I have updated/added relevant examples in `examples` or `docs`.
Not sure, if I can test this properly, as it's on a system level. I
could ensure the values are set though (?)
## Breaking Change?
I'm actually not sure, if this is breaking, I think it's not, as
`audioplayers` used to work like `mixWithOthers` due to a bug, but is
not anymore.
- [ ] Yes, this PR is a breaking change.
- [x] No, this PR is not a breaking change.
<!--
### Migration instructions
If the PR is breaking, uncomment this header and add instructions for
how to migrate from the
currently released version in-between the two following tags:
-->
<!-- End of exclude from commit message -->
---------
Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
I was playing around with the rule avoid-global-state
While I don't think we should enable it, because we do have several totally legitimate cases of what the rule considers global state, it did help me find any current cases where the things just should be final constants.
So this PR will mark semantically final variables as final (or const) proper, exclusively on examples (no violations on actual src code are legit).
This PR adds the following lint rules to our list:
```
always_put_required_named_parameters_first
avoid_multiple_declarations_per_line
avoid_positional_boolean_parameters
avoid_returning_null_for_void
avoid_returning_this
avoid_unnecessary_containers
enable_null_safety
library_private_types_in_public_api
no_leading_underscores_for_library_prefixes
no_leading_underscores_for_local_identifiers
prefer_null_aware_method_calls
tighten_type_of_initializing_formals
unnecessary_late
use_setters_to_change_properties
```
And these rules were considered, and some changes were made according to
them as a clean-up, but in many places they didn't make sense
(`prefer_asserts_with_message` I would have included, but there were too
many places that needed to be changes):
```
collection_methods_unrelated_type
prefer_asserts_with_message
avoid_renaming_method_parameters
```
This updates flame_audio to use the recently released audioplayers 4.0.0
Migration instructions:
AudioPool has moved to AudioPlayers, but we still export it from
flame_audio, so the only thing you have to do if you import AudioPool
directly is to change the import to:
import 'package:flame_audio/flame_audio.dart';
* Game as a component
* Fix component stories
* Effects are now components
* Update effects docs
* Handle swap of parent
* Fix reAddChildren
* Wait for children to be added
* BaseComponent and PositionComponent to be non-abstract
* Simplify HasGameRef
* Revert so that onLoad can be null
* Fix example description
* Effects as components
* Remove gameRef from addChildren
* Fix hasGameRef
* Start migrating effects
* Updated comments of effect fields
* Fix comments
* Continue to fix sequence and combined effects
* Upgrade ordered_set
* Fix position_component_test
* BaseComponent -> Component
* Fix combined and sequence effects
* Await components to be added in tests
* Remove unnecessary game.update in tests
* Fix some tests related to composition
* BaseGame should be used in examples
* Fix CombinedEffect test
* Keyboard code to be based on Component
* Fix keyboard tests
* Fix analyze problems
* Fix sequence_effect
* Fix combined_effect_test
* Store peak state instead of end state
* Fix sequence_effect tests
* Update tutorial
* Fix tutorial 1
* Remove SimplePositionComponentEffect
* Remove unused test variable
* Update docs
* Removed onMount
* Remove onMount
* Add missing dartdoc
* Fix dart docs
* Add super.update where needed
* Move reAddChildren to component
* Reorganize method order in game widget
* preOffset -> initialDelay, postOffset -> peakDelay
* Introduce component.onParentChange
* Remove tests in wrong file
* Fix composed component test
* Add game lifecycle test
* Use BaseGame for mouse cursor test
* Oxygen should (?) not call super.update
* Use BaseGame in keyboard_test
* Fix onLoad to be properly cached
* Re-add unintentionally removed override
* Fix info for collision detection tests
* Add test for correct lifecycle on parent change
* Fix particles example
* Add component lifecycle diagram to the docs
* Add docs for the game lifecycle
* onRemove should be called when a game is removed from the widget
* Fix analyze errors
* prepare should be called from the component itself, not its parent
* Fix dartdoc
* onParentChange -> onMount
* onMount should have void as return type
* Simplify the loaderFuture in GameWidget
* Fix mock_canvas
* Fix rebase problem
* Remove asComponent
* Less complex _loaderFuture
* Add super.update to no_fcs parallax example
* Fix async tests
* Revert _loaderFuture
* Fix analyze issues
* await gameWithCollidables
* Keep epsilon small where it can be
* tappable methods should return bool
* Game lifecycle is now the same as for Component
* Remove mustCallSuper from component.update
* Make onLoadCache protected
* @internal on onLoadCache
* Cache/Memoize debugPaint and debugTextPaint
* Fix imports
* Fix comments
* Always call super.onLoad so that mixins can override it
* Add forgotten super.onLoad
* Bump coverage percentage
* HasCollidables should override update
* Fix Game comments
* Fix some dartdoc
* Apply suggestions from code review
Co-authored-by: Erick <erickzanardoo@gmail.com>
* Game + Loadable as mixins
* Update packages/flame/lib/src/game/game_widget/game_widget.dart
Co-authored-by: Luan Nico <luanpotter27@gmail.com>
* Update loadable docs
* Fix comments
* Move fps_counter
* Fix keyboard example
* Fix dartdoc
* Remove tutorials temporarily
* Fix game lowlevel graph
* Fix resize issue
Co-authored-by: Erick <erickzanardoo@gmail.com>
Co-authored-by: Luan Nico <luanpotter27@gmail.com>