Skip to content
Snippets Groups Projects
Commit 366fcfd8 authored by Benoît Harrault's avatar Benoît Harrault
Browse files

Disable tap on cell when animation runs

parent fe8946d2
No related branches found
No related tags found
1 merge request!15Resolve "Disable tap on cell when animation runs"
Pipeline #4914 passed
org.gradle.jvmargs=-Xmx1536M org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
app.versionName=0.0.12 app.versionName=0.0.13
app.versionCode=12 app.versionCode=13
Disable delete bloc if animation is running.
Désactive la suppression de bloc si une animation est en cours.
...@@ -104,6 +104,16 @@ class _GameBoard extends State<GameBoard> with TickerProviderStateMixin { ...@@ -104,6 +104,16 @@ class _GameBoard extends State<GameBoard> with TickerProviderStateMixin {
return GestureDetector( return GestureDetector(
onTapUp: (details) { onTapUp: (details) {
bool canRemoveCell = true;
animations.forEach((row) {
row.forEach((cell) {
if (cell != null) {
canRemoveCell = false;
}
});
});
if (canRemoveCell) {
final double xTap = details.localPosition.dx; final double xTap = details.localPosition.dx;
final double yTap = details.localPosition.dy; final double yTap = details.localPosition.dy;
final int col = xTap ~/ (displayWidth / currentGame.settings.boardSize); final int col = xTap ~/ (displayWidth / currentGame.settings.boardSize);
...@@ -111,6 +121,7 @@ class _GameBoard extends State<GameBoard> with TickerProviderStateMixin { ...@@ -111,6 +121,7 @@ class _GameBoard extends State<GameBoard> with TickerProviderStateMixin {
final GameCubit gameCubit = BlocProvider.of<GameCubit>(context); final GameCubit gameCubit = BlocProvider.of<GameCubit>(context);
animateCells(gameCubit.tapOnCell(CellLocation.go(row, col))); animateCells(gameCubit.tapOnCell(CellLocation.go(row, col)));
}
}, },
child: CustomPaint( child: CustomPaint(
size: Size(displayWidth, displayWidth), size: Size(displayWidth, displayWidth),
......
...@@ -3,7 +3,7 @@ description: Jeweled Game ...@@ -3,7 +3,7 @@ description: Jeweled Game
publish_to: 'none' publish_to: 'none'
version: 0.0.12+12 version: 0.0.13+13
environment: environment:
sdk: '^3.0.0' sdk: '^3.0.0'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment