()
| 374 | } |
| 375 | |
| 376 | fixPos() { |
| 377 | const actualX = this.pos[this.pos.length - 1][0] - this.pos[1][0]; |
| 378 | const deviation = this.puzzleX - actualX; |
| 379 | |
| 380 | if (Math.abs(deviation) > 4) { |
| 381 | this.moveToAndCollect({ |
| 382 | x: deviation, |
| 383 | y: parseInt(Math.random() * 8 - 3, 10), |
| 384 | duration: 250, |
| 385 | }); |
| 386 | } |
| 387 | } |
| 388 | |
| 389 | moveToAndCollect({x, y, duration}) { |
| 390 | let movedX = 0; |