|
@@ -427,24 +427,10 @@ const circleOne = {
|
|
|
validPath.x0 +
|
|
|
self.circles.list[0].info.distance * self.circles.list[0].info.direc;
|
|
|
|
|
|
- if (gameMode === 'b') {
|
|
|
-
|
|
|
-
|
|
|
- let isBeforeMin, isAfterMax;
|
|
|
- if (gameOperation === 'minus') {
|
|
|
- isBeforeMin = self.control.correctX > validPath.x0;
|
|
|
- isAfterMax =
|
|
|
- self.control.correctX <
|
|
|
- validPath.x0 - 5 * validPath.distanceBetweenPoints;
|
|
|
- } else {
|
|
|
- isBeforeMin = self.control.correctX < validPath.x0;
|
|
|
- isAfterMax =
|
|
|
- self.control.correctX >
|
|
|
- validPath.x0 + 5 * validPath.distanceBetweenPoints;
|
|
|
- }
|
|
|
- if (isBeforeMin || isAfterMax) restart = true;
|
|
|
+ let finalPosition = self.control.correctX;
|
|
|
|
|
|
-
|
|
|
+ if (gameMode === 'b') {
|
|
|
+
|
|
|
balloonX = validPath.x0;
|
|
|
|
|
|
self.control.correctIndex = game.math.randomInRange(
|
|
@@ -457,20 +443,23 @@ const circleOne = {
|
|
|
self.circles.list[i].info.distance *
|
|
|
self.circles.list[i].info.direc;
|
|
|
}
|
|
|
+ finalPosition = balloonX;
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- if (gameOperation === 'minus') {
|
|
|
- isBeforeMin = balloonX > validPath.x0;
|
|
|
- isAfterMax =
|
|
|
- balloonX < validPath.x0 - 5 * validPath.distanceBetweenPoints;
|
|
|
- } else {
|
|
|
- isBeforeMin = balloonX < validPath.x0;
|
|
|
- isAfterMax =
|
|
|
- balloonX > validPath.x0 + 5 * validPath.distanceBetweenPoints;
|
|
|
- }
|
|
|
- if (isBeforeMin || isAfterMax) restart = true;
|
|
|
+ let isBeforeMin = (isAfterMax = false);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (gameOperation === 'minus') {
|
|
|
+ isBeforeMin = finalPosition > validPath.x0;
|
|
|
+ isAfterMax =
|
|
|
+ finalPosition < validPath.x0 - 5 * validPath.distanceBetweenPoints;
|
|
|
+ } else {
|
|
|
+ isBeforeMin = finalPosition < validPath.x0;
|
|
|
+ isAfterMax =
|
|
|
+ finalPosition > validPath.x0 + 5 * validPath.distanceBetweenPoints;
|
|
|
}
|
|
|
+ if (isBeforeMin || isAfterMax) restart = true;
|
|
|
|
|
|
return [restart, balloonX];
|
|
|
},
|