3 ms·
This never presses the down key. A small correction so it'll move randomly in all directions function step() { var eventObj = document.createEvent("Eve
by goldbeck 13y ago
This never presses the down key. A small correction so it'll move randomly in all directions
function step() {
var eventObj = document.createEvent("Events");
eventObj.initEvent("keydown", true, true);
eventObj.which = 37 + Math.floor(Math.random(0, 1)*4);
document.dispatchEvent(eventObj);
}
int = setInterval(step, 0.001);