diff --git a/android/gradle.properties b/android/gradle.properties index 777ac2de0980e935649cf32bd85097eaf789185a..cd2d833ca96b3d1ada4a39df51dc5f5ee67665b7 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,5 +1,5 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true -app.versionName=0.0.16 -app.versionCode=16 +app.versionName=0.0.17 +app.versionCode=17 diff --git a/fastlane/metadata/android/en-US/changelogs/17.txt b/fastlane/metadata/android/en-US/changelogs/17.txt new file mode 100644 index 0000000000000000000000000000000000000000..8248fb3a5bf239c32942421b4f0cf9eebea4b4cb --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/17.txt @@ -0,0 +1 @@ +Fix delete cells on top line. diff --git a/fastlane/metadata/android/fr-FR/changelogs/17.txt b/fastlane/metadata/android/fr-FR/changelogs/17.txt new file mode 100644 index 0000000000000000000000000000000000000000..52fa08df08b41bdb22990441248ea48ba799e09b --- /dev/null +++ b/fastlane/metadata/android/fr-FR/changelogs/17.txt @@ -0,0 +1 @@ +Correction sur la suppression de cellules sur la première ligne. diff --git a/lib/config/default_game_settings.dart b/lib/config/default_game_settings.dart index a8f11fa1d0ae2014a27b912d19ae22efac186a8c..7c9e2c8fb6d44b8361afa1cf8a3030985aa09166 100644 --- a/lib/config/default_game_settings.dart +++ b/lib/config/default_game_settings.dart @@ -30,4 +30,6 @@ class DefaultGameSettings { return []; } + + static int blockMinimumCellsCount = 3; } diff --git a/lib/cubit/game_cubit.dart b/lib/cubit/game_cubit.dart index 1eb55172b98e245dc79cd2f69a0b3be28a9c42a9..cc446d662f6b5a537177d60c4b91eab5651da77d 100644 --- a/lib/cubit/game_cubit.dart +++ b/lib/cubit/game_cubit.dart @@ -1,6 +1,7 @@ import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:hydrated_bloc/hydrated_bloc.dart'; +import 'package:jeweled/config/default_game_settings.dart'; import 'package:jeweled/models/game.dart'; import 'package:jeweled/models/cell_location.dart'; @@ -109,7 +110,7 @@ class GameCubit extends HydratedCubit<GameState> { if (cellValue != null) { List<CellLocation> blockCells = currentGame.getSiblingCells(tappedCellLocation, []); - if (blockCells.length >= 3) { + if (blockCells.length >= DefaultGameSettings.blockMinimumCellsCount) { this.deleteBlock(blockCells); this.increaseMovesCount(); this.increaseScore(getScoreFromBlock(blockCells.length)); diff --git a/lib/ui/widgets/game_board.dart b/lib/ui/widgets/game_board.dart index c2ca025a77ef126eb1e07c3136fa436d9d2c82bc..e17b1b12fd426e0b924b398ce82a4b263b265e71 100644 --- a/lib/ui/widgets/game_board.dart +++ b/lib/ui/widgets/game_board.dart @@ -79,14 +79,20 @@ class _GameBoard extends State<GameBoard> with TickerProviderStateMixin { }); // Build animation for each cell to move + bool needAnimation = false; cellsToRemove.forEach((cellToRemove) { for (int i = 0; i < cellToRemove.row; i++) { final int stepsCount = stepsDownCounts[(cellToRemove.row - i) - 1][cellToRemove.col]; this.animations[(cellToRemove.row - i) - 1][cellToRemove.col] = animation(stepsCount); + needAnimation = true; } }); controller.forward().orCancel; + + if (!needAnimation) { + gameCubit.postAnimate(); + } } @override @@ -104,16 +110,16 @@ class _GameBoard extends State<GameBoard> with TickerProviderStateMixin { return GestureDetector( onTapUp: (details) { - bool canRemoveCell = true; + bool animationInProgress = false; animations.forEach((row) { row.forEach((cell) { if (cell != null) { - canRemoveCell = false; + animationInProgress = true; } }); }); - if (canRemoveCell) { + if (!animationInProgress) { final double xTap = details.localPosition.dx; final double yTap = details.localPosition.dy; final int col = xTap ~/ (displayWidth / currentGame.settings.boardSize); diff --git a/pubspec.yaml b/pubspec.yaml index a03d987fe7e53069e9b4caf7c76d96fc1ca5a596..542bbc66f64c1090829b7e4a5bfb09bec029b0f4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: Jeweled Game publish_to: 'none' -version: 0.0.16+16 +version: 0.0.17+17 environment: sdk: '^3.0.0'