Magic cube added
This commit is contained in:
parent
34d7687dc0
commit
dd2ac2fcce
BIN
assets/audio/explosion.ogg
Normal file
BIN
assets/audio/explosion.ogg
Normal file
Binary file not shown.
BIN
assets/audio/four_elements.ogg
Normal file
BIN
assets/audio/four_elements.ogg
Normal file
Binary file not shown.
BIN
assets/audio/select.ogg
Normal file
BIN
assets/audio/select.ogg
Normal file
Binary file not shown.
BIN
assets/images/magic_cube.png
Normal file
BIN
assets/images/magic_cube.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 208 KiB |
@ -3,6 +3,7 @@ import 'package:flame/components.dart';
|
|||||||
import 'package:flame/effects.dart';
|
import 'package:flame/effects.dart';
|
||||||
import 'package:flame/game.dart';
|
import 'package:flame/game.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:match_magic/utilities/audio_manager.dart';
|
||||||
import 'tile.dart';
|
import 'tile.dart';
|
||||||
import 'package:flame/sprite.dart';
|
import 'package:flame/sprite.dart';
|
||||||
import 'swap_notifier.dart';
|
import 'swap_notifier.dart';
|
||||||
@ -10,6 +11,7 @@ import 'swap_notifier.dart';
|
|||||||
class Board extends FlameGame {
|
class Board extends FlameGame {
|
||||||
final List<Sprite> sprites;
|
final List<Sprite> sprites;
|
||||||
final SwapNotifier swapNotifier;
|
final SwapNotifier swapNotifier;
|
||||||
|
final Sprite magicCubeSprite;
|
||||||
static const int rows = 8;
|
static const int rows = 8;
|
||||||
static const int cols = 8;
|
static const int cols = 8;
|
||||||
late double tileSize;
|
late double tileSize;
|
||||||
@ -22,7 +24,11 @@ class Board extends FlameGame {
|
|||||||
|
|
||||||
bool isFirstLaunch = true;
|
bool isFirstLaunch = true;
|
||||||
|
|
||||||
Board({required this.sprites, required this.swapNotifier});
|
Board({
|
||||||
|
required this.sprites,
|
||||||
|
required this.swapNotifier,
|
||||||
|
required this.magicCubeSprite,
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> onLoad() async {
|
Future<void> onLoad() async {
|
||||||
@ -43,8 +49,8 @@ class Board extends FlameGame {
|
|||||||
|
|
||||||
void restartGame() {
|
void restartGame() {
|
||||||
isFirstLaunch = true;
|
isFirstLaunch = true;
|
||||||
_resetGame();
|
|
||||||
swapNotifier.resetScore();
|
swapNotifier.resetScore();
|
||||||
|
_resetGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
void _initializeGrid(bool animate) {
|
void _initializeGrid(bool animate) {
|
||||||
@ -109,27 +115,59 @@ class Board extends FlameGame {
|
|||||||
} while (hasMatches);
|
} while (hasMatches);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Future<void> handleTileSwipe(Tile tile, Vector2 delta) async {
|
||||||
|
// if (animating) return;
|
||||||
|
|
||||||
|
// int row = tile.row;
|
||||||
|
// int col = tile.col;
|
||||||
|
// Tile? targetTile;
|
||||||
|
|
||||||
|
// if (delta.x.abs() > delta.y.abs()) {
|
||||||
|
// if (delta.x > 0 && col < cols - 1) {
|
||||||
|
// targetTile = tiles[row][col + 1];
|
||||||
|
// } else if (delta.x < 0 && col > 0) {
|
||||||
|
// targetTile = tiles[row][col - 1];
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// if (delta.y > 0 && row < rows - 1) {
|
||||||
|
// targetTile = tiles[row + 1][col];
|
||||||
|
// } else if (delta.y < 0 && row > 0) {
|
||||||
|
// targetTile = tiles[row - 1][col];
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (targetTile != null) {
|
||||||
|
// animating = true;
|
||||||
|
// lastMovedTile = tile;
|
||||||
|
// swapTiles(tile, targetTile, true);
|
||||||
|
|
||||||
|
// await Future.delayed(const Duration(milliseconds: 300));
|
||||||
|
|
||||||
|
// if (!checkMatches()) {
|
||||||
|
// swapTiles(tile, targetTile, true);
|
||||||
|
// } else {
|
||||||
|
// swapNotifier.incrementMoveCount();
|
||||||
|
// }
|
||||||
|
// selectedRow = null;
|
||||||
|
// selectedCol = null;
|
||||||
|
// animating = false;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
Future<void> handleTileSwipe(Tile tile, Vector2 delta) async {
|
Future<void> handleTileSwipe(Tile tile, Vector2 delta) async {
|
||||||
if (animating) return;
|
if (animating) return;
|
||||||
|
|
||||||
int row = tile.row;
|
|
||||||
int col = tile.col;
|
|
||||||
Tile? targetTile;
|
Tile? targetTile;
|
||||||
|
|
||||||
if (delta.x.abs() > delta.y.abs()) {
|
if (tile.isMagicCube) {
|
||||||
if (delta.x > 0 && col < cols - 1) {
|
targetTile = _getTileBySwipeDirection(tile, delta);
|
||||||
targetTile = tiles[row][col + 1];
|
if (targetTile != null) {
|
||||||
} else if (delta.x < 0 && col > 0) {
|
_removeAllOfType(targetTile.spriteIndex);
|
||||||
targetTile = tiles[row][col - 1];
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (delta.y > 0 && row < rows - 1) {
|
|
||||||
targetTile = tiles[row + 1][col];
|
|
||||||
} else if (delta.y < 0 && row > 0) {
|
|
||||||
targetTile = tiles[row - 1][col];
|
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
targetTile = _getTileBySwipeDirection(tile, delta);
|
||||||
|
|
||||||
if (targetTile != null) {
|
if (targetTile != null) {
|
||||||
animating = true;
|
animating = true;
|
||||||
lastMovedTile = tile;
|
lastMovedTile = tile;
|
||||||
@ -148,6 +186,41 @@ class Board extends FlameGame {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Tile? _getTileBySwipeDirection(Tile tile, Vector2 delta) {
|
||||||
|
int row = tile.row;
|
||||||
|
int col = tile.col;
|
||||||
|
Tile? targetTile;
|
||||||
|
|
||||||
|
if (delta.x.abs() > delta.y.abs()) {
|
||||||
|
if (delta.x > 0 && col < cols - 1) {
|
||||||
|
targetTile = tiles[row][col + 1];
|
||||||
|
} else if (delta.x < 0 && col > 0) {
|
||||||
|
targetTile = tiles[row][col - 1];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (delta.y > 0 && row < rows - 1) {
|
||||||
|
targetTile = tiles[row + 1][col];
|
||||||
|
} else if (delta.y < 0 && row > 0) {
|
||||||
|
targetTile = tiles[row - 1][col];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return targetTile;
|
||||||
|
}
|
||||||
|
|
||||||
|
void _removeAllOfType(int spriteIndex) {
|
||||||
|
for (int row = 0; row < rows; row++) {
|
||||||
|
for (int col = 0; col < cols; col++) {
|
||||||
|
if (tiles[row][col]?.spriteIndex == spriteIndex) {
|
||||||
|
_animateRemoveTile(tiles[row][col]!);
|
||||||
|
tiles[row][col] = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_applyGravity();
|
||||||
|
_fillEmptySpaces();
|
||||||
|
}
|
||||||
|
|
||||||
bool _isAdjacent(int row1, int col1, int row2, int col2) {
|
bool _isAdjacent(int row1, int col1, int row2, int col2) {
|
||||||
return (row1 == row2 && (col1 - col2).abs() == 1) ||
|
return (row1 == row2 && (col1 - col2).abs() == 1) ||
|
||||||
(col1 == col2 && (row1 - row2).abs() == 1);
|
(col1 == col2 && (row1 - row2).abs() == 1);
|
||||||
@ -206,6 +279,7 @@ class Board extends FlameGame {
|
|||||||
for (final match in matches) {
|
for (final match in matches) {
|
||||||
points += _removeMatchedElements(match[0], match[1]);
|
points += _removeMatchedElements(match[0], match[1]);
|
||||||
}
|
}
|
||||||
|
AudioManager.playSelectSound();
|
||||||
Future.delayed(const Duration(milliseconds: 300), () {
|
Future.delayed(const Duration(milliseconds: 300), () {
|
||||||
_applyGravity();
|
_applyGravity();
|
||||||
Future.delayed(const Duration(milliseconds: 300), () {
|
Future.delayed(const Duration(milliseconds: 300), () {
|
||||||
@ -308,6 +382,7 @@ class Board extends FlameGame {
|
|||||||
|
|
||||||
if (tileToTransformIntoBomb != null) {
|
if (tileToTransformIntoBomb != null) {
|
||||||
_createBomb(tileToTransformIntoBomb.row, tileToTransformIntoBomb.col);
|
_createBomb(tileToTransformIntoBomb.row, tileToTransformIntoBomb.col);
|
||||||
|
AudioManager.playFourElementsSound();
|
||||||
}
|
}
|
||||||
|
|
||||||
return score;
|
return score;
|
||||||
@ -337,6 +412,7 @@ class Board extends FlameGame {
|
|||||||
|
|
||||||
_animateRemoveTile(tile);
|
_animateRemoveTile(tile);
|
||||||
tiles[row][col] = null;
|
tiles[row][col] = null;
|
||||||
|
AudioManager.playExplosionSound();
|
||||||
}
|
}
|
||||||
|
|
||||||
void _animateBombExplosion(Vector2 position) {
|
void _animateBombExplosion(Vector2 position) {
|
||||||
@ -368,10 +444,21 @@ class Board extends FlameGame {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// void _animateRemoveTile(Tile tile) {
|
||||||
|
// tile.add(RemoveEffect(
|
||||||
|
// delay: 0.5,
|
||||||
|
// onComplete: () => remove(tile),
|
||||||
|
// ));
|
||||||
|
// }
|
||||||
|
|
||||||
void _animateRemoveTile(Tile tile) {
|
void _animateRemoveTile(Tile tile) {
|
||||||
tile.add(RemoveEffect(
|
tile.add(ScaleEffect.to(
|
||||||
delay: 0.5,
|
Vector2.zero(),
|
||||||
onComplete: () => remove(tile),
|
EffectController(
|
||||||
|
duration: 0.2,
|
||||||
|
curve: Curves.easeInBack,
|
||||||
|
),
|
||||||
|
onComplete: () => tile.removeFromParent(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -407,32 +494,9 @@ class Board extends FlameGame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _createMagicCube(int row, int col) {
|
void _createMagicCube(int row, int col) {
|
||||||
final tile = tiles[row][col]!;
|
var tile = tiles[row][col];
|
||||||
tile.isMagicCube = true;
|
tile?.sprite = magicCubeSprite;
|
||||||
|
tile?.isMagicCube = true;
|
||||||
tile.add(
|
|
||||||
OpacityEffect.to(
|
|
||||||
0.5,
|
|
||||||
EffectController(
|
|
||||||
duration: 0.5,
|
|
||||||
infinite: true,
|
|
||||||
reverseDuration: 0.5,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
tile.add(
|
|
||||||
ColorEffect(
|
|
||||||
Colors.purple,
|
|
||||||
EffectController(
|
|
||||||
duration: 0.5,
|
|
||||||
infinite: true,
|
|
||||||
reverseDuration: 0.5,
|
|
||||||
),
|
|
||||||
opacityFrom: 0.5,
|
|
||||||
opacityTo: 1.0,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void explodeBomb(Tile bombTile) {
|
void explodeBomb(Tile bombTile) {
|
||||||
|
@ -2,6 +2,7 @@ import 'package:flame/components.dart';
|
|||||||
import 'package:flame/game.dart';
|
import 'package:flame/game.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:match_magic/game/sprite_loader.dart';
|
import 'package:match_magic/game/sprite_loader.dart';
|
||||||
|
import 'package:match_magic/utilities/audio_manager.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'board.dart';
|
import 'board.dart';
|
||||||
import 'swap_notifier.dart';
|
import 'swap_notifier.dart';
|
||||||
@ -14,20 +15,24 @@ class MatchMagicGameScreen extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _MatchMagicGameScreenState extends State<MatchMagicGameScreen> {
|
class _MatchMagicGameScreenState extends State<MatchMagicGameScreen> {
|
||||||
late Future<List<Sprite>> _spritesFuture;
|
late Future<List<Sprite>> _crystalsFuture;
|
||||||
|
late Future<Sprite> _magicCubeFuture;
|
||||||
Board? board;
|
Board? board;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_spritesFuture = SpriteLoader.loadSprites();
|
_crystalsFuture = SpriteLoader.loadCrystalSprites();
|
||||||
|
_magicCubeFuture = SpriteLoader.loadMagicCubeSprite();
|
||||||
|
AudioManager.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
void _restartGame() {
|
void _restartGame() {
|
||||||
context.read<SwapNotifier>().resetScore();
|
context.read<SwapNotifier>().resetScore();
|
||||||
setState(() {
|
setState(() {
|
||||||
board = null;
|
board = null;
|
||||||
_spritesFuture = SpriteLoader.loadSprites();
|
_crystalsFuture = SpriteLoader.loadCrystalSprites();
|
||||||
|
_magicCubeFuture = SpriteLoader.loadMagicCubeSprite();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,6 +76,7 @@ class _MatchMagicGameScreenState extends State<MatchMagicGameScreen> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
Navigator.of(context).popUntil((route) => route.isFirst);
|
Navigator.of(context).popUntil((route) => route.isFirst);
|
||||||
|
context.read<SwapNotifier>().resetScore();
|
||||||
},
|
},
|
||||||
child: const Text('Yes'),
|
child: const Text('Yes'),
|
||||||
),
|
),
|
||||||
@ -91,17 +97,36 @@ class _MatchMagicGameScreenState extends State<MatchMagicGameScreen> {
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Colors.black,
|
backgroundColor: Colors.black,
|
||||||
body: FutureBuilder<List<Sprite>>(
|
body: FutureBuilder<List<Sprite>>(
|
||||||
future: _spritesFuture,
|
future: _crystalsFuture,
|
||||||
builder: (context, snapshot) {
|
builder: (context, crystalSnapshot) {
|
||||||
if (snapshot.connectionState == ConnectionState.done) {
|
if (crystalSnapshot.connectionState == ConnectionState.done) {
|
||||||
if (snapshot.hasError) {
|
if (crystalSnapshot.hasError) {
|
||||||
return Center(child: Text('Error: ${snapshot.error}'));
|
return Center(child: Text('Error: ${crystalSnapshot.error}'));
|
||||||
} else if (!snapshot.hasData || snapshot.data == null) {
|
} else if (!crystalSnapshot.hasData ||
|
||||||
return const Center(child: Text('No sprites found'));
|
crystalSnapshot.data == null) {
|
||||||
|
return const Center(child: Text('No crystal sprites found'));
|
||||||
} else {
|
} else {
|
||||||
final sprites = snapshot.data!;
|
final crystals = crystalSnapshot.data!;
|
||||||
|
|
||||||
|
return FutureBuilder<Sprite>(
|
||||||
|
future: _magicCubeFuture,
|
||||||
|
builder: (context, cubeSnapshot) {
|
||||||
|
if (cubeSnapshot.connectionState == ConnectionState.done) {
|
||||||
|
if (cubeSnapshot.hasError) {
|
||||||
|
return Center(
|
||||||
|
child: Text('Error: ${cubeSnapshot.error}'));
|
||||||
|
} else if (!cubeSnapshot.hasData ||
|
||||||
|
cubeSnapshot.data == null) {
|
||||||
|
return const Center(
|
||||||
|
child: Text('No magic cube sprite found'));
|
||||||
|
} else {
|
||||||
|
final magicCube = cubeSnapshot.data!;
|
||||||
|
|
||||||
board ??= Board(
|
board ??= Board(
|
||||||
sprites: sprites, swapNotifier: context.read<SwapNotifier>());
|
sprites: crystals,
|
||||||
|
magicCubeSprite: magicCube,
|
||||||
|
swapNotifier: context.read<SwapNotifier>(),
|
||||||
|
);
|
||||||
|
|
||||||
return Stack(
|
return Stack(
|
||||||
children: [
|
children: [
|
||||||
@ -146,7 +171,8 @@ class _MatchMagicGameScreenState extends State<MatchMagicGameScreen> {
|
|||||||
top: 16,
|
top: 16,
|
||||||
left: 16,
|
left: 16,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
icon: const Icon(Icons.settings, color: Colors.white),
|
icon: const Icon(Icons.settings,
|
||||||
|
color: Colors.white),
|
||||||
onPressed: _showSettingsDialog,
|
onPressed: _showSettingsDialog,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -157,6 +183,12 @@ class _MatchMagicGameScreenState extends State<MatchMagicGameScreen> {
|
|||||||
return const Center(child: CircularProgressIndicator());
|
return const Center(child: CircularProgressIndicator());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return const Center(child: CircularProgressIndicator());
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,15 @@
|
|||||||
import 'package:flame/components.dart';
|
import 'package:flame/components.dart';
|
||||||
|
|
||||||
class SpriteLoader {
|
class SpriteLoader {
|
||||||
static Future<List<Sprite>> loadSprites() async {
|
static Future<List<Sprite>> loadCrystalSprites() async {
|
||||||
List<Sprite> sprites = [];
|
List<Sprite> sprites = [];
|
||||||
for (int i = 1; i <= 7; i++) {
|
for (int i = 1; i <= 7; i++) {
|
||||||
sprites.add(await Sprite.load('crystal$i.png'));
|
sprites.add(await Sprite.load('crystal$i.png'));
|
||||||
}
|
}
|
||||||
return sprites;
|
return sprites;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Future<Sprite> loadMagicCubeSprite() async {
|
||||||
|
return Sprite.load('magic_cube.png');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ class SwapNotifier extends ChangeNotifier {
|
|||||||
selectedTile = tile;
|
selectedTile = tile;
|
||||||
tile.select();
|
tile.select();
|
||||||
} else {
|
} else {
|
||||||
if (_isNeighbor(selectedTile!, tile)) {
|
if (_isNeighbor(selectedTile!, tile) || selectedTile!.isMagicCube) {
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
} else {
|
} else {
|
||||||
selectedTile?.deselect();
|
selectedTile?.deselect();
|
||||||
|
@ -102,12 +102,10 @@ class Tile extends SpriteComponent with TapCallbacks, DragCallbacks {
|
|||||||
|
|
||||||
void animateMoveTo(Vector2 newPosition, VoidCallback onComplete) {
|
void animateMoveTo(Vector2 newPosition, VoidCallback onComplete) {
|
||||||
isAnimating = true;
|
isAnimating = true;
|
||||||
print('animation start');
|
|
||||||
add(MoveEffect.to(
|
add(MoveEffect.to(
|
||||||
newPosition,
|
newPosition,
|
||||||
EffectController(duration: 0.3),
|
EffectController(duration: 0.3),
|
||||||
onComplete: () {
|
onComplete: () {
|
||||||
print('animation complete');
|
|
||||||
isAnimating = false;
|
isAnimating = false;
|
||||||
onComplete();
|
onComplete();
|
||||||
},
|
},
|
||||||
|
23
lib/utilities/audio_manager.dart
Normal file
23
lib/utilities/audio_manager.dart
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
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');
|
||||||
|
}
|
||||||
|
}
|
@ -6,6 +6,10 @@
|
|||||||
|
|
||||||
#include "generated_plugin_registrant.h"
|
#include "generated_plugin_registrant.h"
|
||||||
|
|
||||||
|
#include <audioplayers_linux/audioplayers_linux_plugin.h>
|
||||||
|
|
||||||
void fl_register_plugins(FlPluginRegistry* registry) {
|
void fl_register_plugins(FlPluginRegistry* registry) {
|
||||||
|
g_autoptr(FlPluginRegistrar) audioplayers_linux_registrar =
|
||||||
|
fl_plugin_registry_get_registrar_for_plugin(registry, "AudioplayersLinuxPlugin");
|
||||||
|
audioplayers_linux_plugin_register_with_registrar(audioplayers_linux_registrar);
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
|
audioplayers_linux
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||||
|
@ -5,6 +5,10 @@
|
|||||||
import FlutterMacOS
|
import FlutterMacOS
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
import audioplayers_darwin
|
||||||
|
import path_provider_foundation
|
||||||
|
|
||||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
|
AudioplayersDarwinPlugin.register(with: registry.registrar(forPlugin: "AudioplayersDarwinPlugin"))
|
||||||
|
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||||
}
|
}
|
||||||
|
237
pubspec.lock
237
pubspec.lock
@ -9,6 +9,62 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.11.0"
|
version: "2.11.0"
|
||||||
|
audioplayers:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: audioplayers
|
||||||
|
sha256: c346ba5a39dc208f1bab55fc239855f573d69b0e832402114bf0b793622adc4d
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.1.0"
|
||||||
|
audioplayers_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: audioplayers_android
|
||||||
|
sha256: de576b890befe27175c2f511ba8b742bec83765fa97c3ce4282bba46212f58e4
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "5.0.0"
|
||||||
|
audioplayers_darwin:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: audioplayers_darwin
|
||||||
|
sha256: e507887f3ff18d8e5a10a668d7bedc28206b12e10b98347797257c6ae1019c3b
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.0.0"
|
||||||
|
audioplayers_linux:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: audioplayers_linux
|
||||||
|
sha256: "3d3d244c90436115417f170426ce768856d8fe4dfc5ed66a049d2890acfa82f9"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.0.0"
|
||||||
|
audioplayers_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: audioplayers_platform_interface
|
||||||
|
sha256: "6834dd48dfb7bc6c2404998ebdd161f79cd3774a7e6779e1348d54a3bfdcfaa5"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "7.0.0"
|
||||||
|
audioplayers_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: audioplayers_web
|
||||||
|
sha256: "3609bdf0e05e66a3d9750ee40b1e37f2a622c4edb796cc600b53a90a30a2ace4"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "5.0.1"
|
||||||
|
audioplayers_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: audioplayers_windows
|
||||||
|
sha256: "8605762dddba992138d476f6a0c3afd9df30ac5b96039929063eceed416795c2"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.0.0"
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -41,6 +97,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.18.0"
|
version: "1.18.0"
|
||||||
|
crypto:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: crypto
|
||||||
|
sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.5"
|
||||||
cupertino_icons:
|
cupertino_icons:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -57,14 +121,46 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.1"
|
version: "1.3.1"
|
||||||
|
ffi:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: ffi
|
||||||
|
sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.3"
|
||||||
|
file:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: file
|
||||||
|
sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "7.0.0"
|
||||||
|
fixnum:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: fixnum
|
||||||
|
sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.0"
|
||||||
flame:
|
flame:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: flame
|
name: flame
|
||||||
sha256: "79133dc46a3ff870950f41d0dc1598414e7bd7ae2c29bd9f0a9de208d9a70cb7"
|
sha256: e6873a8540a197a9bfe251e10c9e1f200329041d6e6d70df2cf38aa681cf2ef7
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.18.0"
|
version: "1.19.0"
|
||||||
|
flame_audio:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flame_audio
|
||||||
|
sha256: a86839f1448bbf9e2cd9c5d396be8dfc745428a9d27db6dfcdd9680466d8370e
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.10.3"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
@ -83,6 +179,27 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_web_plugins:
|
||||||
|
dependency: transitive
|
||||||
|
description: flutter
|
||||||
|
source: sdk
|
||||||
|
version: "0.0.0"
|
||||||
|
http:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: http
|
||||||
|
sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.2.2"
|
||||||
|
http_parser:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: http_parser
|
||||||
|
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.0.2"
|
||||||
leak_tracker:
|
leak_tracker:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -151,10 +268,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: ordered_set
|
name: ordered_set
|
||||||
sha256: "1bfaaaee0419e43ecc9eaebd410eb4bd5039657b72011de75ff3e2915c9aac60"
|
sha256: "984658d0c28c69516ed22f780db7511932a223339463a16c0cc48b3055e926c4"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.0.3"
|
version: "6.0.1"
|
||||||
path:
|
path:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -163,6 +280,70 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.9.0"
|
version: "1.9.0"
|
||||||
|
path_provider:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider
|
||||||
|
sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.4"
|
||||||
|
path_provider_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_android
|
||||||
|
sha256: "6f01f8e37ec30b07bc424b4deabac37cacb1bc7e2e515ad74486039918a37eb7"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.2.10"
|
||||||
|
path_provider_foundation:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_foundation
|
||||||
|
sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.4.0"
|
||||||
|
path_provider_linux:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_linux
|
||||||
|
sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.2.1"
|
||||||
|
path_provider_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_platform_interface
|
||||||
|
sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.2"
|
||||||
|
path_provider_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_windows
|
||||||
|
sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.3.0"
|
||||||
|
platform:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: platform
|
||||||
|
sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.5"
|
||||||
|
plugin_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: plugin_platform_interface
|
||||||
|
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.8"
|
||||||
provider:
|
provider:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -184,6 +365,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.10.0"
|
version: "1.10.0"
|
||||||
|
sprintf:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: sprintf
|
||||||
|
sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "7.0.0"
|
||||||
stack_trace:
|
stack_trace:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -208,6 +397,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
version: "1.2.0"
|
||||||
|
synchronized:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: synchronized
|
||||||
|
sha256: "539ef412b170d65ecdafd780f924e5be3f60032a1128df156adad6c5b373d558"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.0+1"
|
||||||
term_glyph:
|
term_glyph:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -224,6 +421,22 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.0"
|
version: "0.7.0"
|
||||||
|
typed_data:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: typed_data
|
||||||
|
sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.3.2"
|
||||||
|
uuid:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: uuid
|
||||||
|
sha256: f33d6bb662f0e4f79dcd7ada2e6170f3b3a2530c28fc41f49a411ddedd576a77
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.5.0"
|
||||||
vector_math:
|
vector_math:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -240,6 +453,22 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "14.2.1"
|
version: "14.2.1"
|
||||||
|
web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: web
|
||||||
|
sha256: d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.0"
|
||||||
|
xdg_directories:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: xdg_directories
|
||||||
|
sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.4"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.4.3 <4.0.0"
|
dart: ">=3.4.3 <4.0.0"
|
||||||
flutter: ">=3.22.0"
|
flutter: ">=3.22.0"
|
||||||
|
@ -37,6 +37,8 @@ dependencies:
|
|||||||
# Use with the CupertinoIcons class for iOS style icons.
|
# Use with the CupertinoIcons class for iOS style icons.
|
||||||
cupertino_icons: ^1.0.6
|
cupertino_icons: ^1.0.6
|
||||||
flame: ^1.18.0
|
flame: ^1.18.0
|
||||||
|
audioplayers: ^6.1.0
|
||||||
|
flame_audio: ^2.10.3
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
@ -69,6 +71,11 @@ flutter:
|
|||||||
- assets/images/crystal5.png
|
- assets/images/crystal5.png
|
||||||
- assets/images/crystal6.png
|
- assets/images/crystal6.png
|
||||||
- assets/images/crystal7.png
|
- assets/images/crystal7.png
|
||||||
|
- assets/images/magic_cube.png
|
||||||
|
- assets/audio/explosion.ogg
|
||||||
|
- assets/audio/four_elements.ogg
|
||||||
|
- assets/audio/select.ogg
|
||||||
|
|
||||||
|
|
||||||
# An image asset can refer to one or more resolution-specific "variants", see
|
# An image asset can refer to one or more resolution-specific "variants", see
|
||||||
# https://flutter.dev/assets-and-images/#resolution-aware
|
# https://flutter.dev/assets-and-images/#resolution-aware
|
||||||
|
@ -6,6 +6,9 @@
|
|||||||
|
|
||||||
#include "generated_plugin_registrant.h"
|
#include "generated_plugin_registrant.h"
|
||||||
|
|
||||||
|
#include <audioplayers_windows/audioplayers_windows_plugin.h>
|
||||||
|
|
||||||
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||||
|
AudioplayersWindowsPluginRegisterWithRegistrar(
|
||||||
|
registry->GetRegistrarForPlugin("AudioplayersWindowsPlugin"));
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
|
audioplayers_windows
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||||
|
Loading…
x
Reference in New Issue
Block a user