MCPcopy Create free account
hub / github.com/6dylan6/jdm / constructor

Method constructor

function/jdValidate.js:375–391  ·  view source on GitHub ↗
(puzzleX)

Source from the content-addressed store, hash-verified

373const HZ = 32;
374class 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;

Callers

nothing calls this directly

Calls 3

nowMethod · 0.80
randomMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected