| 337 | } |
| 338 | |
| 339 | run() { |
| 340 | const perX = this.puzzleX / this.STEP; |
| 341 | const perDuration = this.DURATION / this.STEP; |
| 342 | const firstPos = [this.x - parseInt(Math.random() * 6, 10), this.y + parseInt(Math.random() * 11, 10), this.t]; |
| 343 | |
| 344 | this.pos.unshift(firstPos); |
| 345 | this.stepPos(perX, perDuration); |
| 346 | this.fixPos(); |
| 347 | |
| 348 | const reactTime = parseInt(60 + Math.random() * 100, 10); |
| 349 | const lastIdx = this.pos.length - 1; |
| 350 | const lastPos = [this.pos[lastIdx][0], this.pos[lastIdx][1], this.pos[lastIdx][2] + reactTime]; |
| 351 | |
| 352 | this.pos.push(lastPos); |
| 353 | return this.pos; |
| 354 | } |
| 355 | |
| 356 | stepPos(x, duration) { |
| 357 | let n = 0; |