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

Merge branch '17-disable-tap-on-cell-when-animation-runs' into 'master'

Resolve "Disable tap on cell when animation runs"

Closes #17

See merge request !15
parents fe8946d2 366fcfd8
No related branches found
No related tags found
1 merge request!15Resolve "Disable tap on cell when animation runs"
Pipeline #4939 canceled
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
app.versionName=0.0.12
app.versionCode=12
app.versionName=0.0.13
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 {
return GestureDetector(
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 yTap = details.localPosition.dy;
final int col = xTap ~/ (displayWidth / currentGame.settings.boardSize);
......@@ -111,6 +121,7 @@ class _GameBoard extends State<GameBoard> with TickerProviderStateMixin {
final GameCubit gameCubit = BlocProvider.of<GameCubit>(context);
animateCells(gameCubit.tapOnCell(CellLocation.go(row, col)));
}
},
child: CustomPaint(
size: Size(displayWidth, displayWidth),
......
......@@ -3,7 +3,7 @@ description: Jeweled Game
publish_to: 'none'
version: 0.0.12+12
version: 0.0.13+13
environment:
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