()
| 444 | } |
| 445 | |
| 446 | fixPos() { |
| 447 | const actualX = this.pos[this.pos.length - 1][0] - this.pos[1][0]; |
| 448 | const deviation = this.puzzleX - actualX; |
| 449 | |
| 450 | if (Math.abs(deviation) > 4) { |
| 451 | this.moveToAndCollect({ |
| 452 | x: deviation, |
| 453 | y: parseInt(Math.random() * 8 - 3, 10), |
| 454 | duration: 250, |
| 455 | }); |
| 456 | } |
| 457 | } |
| 458 | |
| 459 | moveToAndCollect({x, y, duration}) { |
| 460 | let movedX = 0; |