| 373 | const HZ = 32; |
| 374 | class MousePosFaker { |
| 375 | constructor(puzzleX) { |
| 376 | this.x = parseInt(Math.random() * 20 + 20, 10); |
| 377 | this.y = parseInt(Math.random() * 80 + 80, 10); |
| 378 | this.t = Date.now(); |
| 379 | this.pos = [ |
| 380 | [this.x, this.y, this.t] |
| 381 | ]; |
| 382 | this.minDuration = parseInt(1000 / HZ, 10); |
| 383 | // this.puzzleX = puzzleX; |
| 384 | this.puzzleX = puzzleX + parseInt(Math.random() * 2 - 1, 10); |
| 385 | this.STEP = parseInt(Math.random() * 6 + 5, 10); |
| 386 | this.DURATION = parseInt(Math.random() * 7 + 12, 10) * 100; |
| 387 | // [9,1600] [10,1400] |
| 388 | this.STEP = 9; |
| 389 | // this.DURATION = 2000; |
| 390 | console.log(this.STEP, this.DURATION); |
| 391 | } |
| 392 | run() { |
| 393 | const perX = this.puzzleX / this.STEP; |
| 394 | const perDuration = this.DURATION / this.STEP; |