feat: Implement packaged games loading and update engine initialization to support seeded games
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
@@ -39,7 +39,30 @@ final Wolf3dFlutterEngine engine = await Wolf3dFlutterEngine(
|
||||
).init();
|
||||
```
|
||||
|
||||
`init()` handles platform setup, audio init, and configured game-data discovery.
|
||||
`init()` handles platform setup, audio init, configured external discovery, and
|
||||
optional seeded game injection.
|
||||
|
||||
To load packaged game data from `wolf_3d_assets`, use
|
||||
`Wolf3dFlutterEngine.loadGameDataFromAssets(...)` and pass the result via
|
||||
`seededGames`:
|
||||
|
||||
```dart
|
||||
final retail = await Wolf3dFlutterEngine.loadGameDataFromAssets(
|
||||
version: GameVersion.retail,
|
||||
packageName: 'wolf_3d_assets',
|
||||
assetDirectory: 'assets/retail',
|
||||
);
|
||||
|
||||
final shareware = await Wolf3dFlutterEngine.loadGameDataFromAssets(
|
||||
version: GameVersion.shareware,
|
||||
packageName: 'wolf_3d_assets',
|
||||
assetDirectory: 'assets/shareware',
|
||||
);
|
||||
|
||||
final Wolf3dFlutterEngine engine = await Wolf3dFlutterEngine(
|
||||
debug: kDebugMode,
|
||||
).init(seededGames: [retail, shareware]);
|
||||
```
|
||||
|
||||
The facade itself lives in `lib/engine/wolf3d_flutter_engine.dart` and is re-exported
|
||||
through the package barrel at `lib/wolf_3d_flutter.dart`. External consumers
|
||||
|
||||
Reference in New Issue
Block a user