| This way you can hit the ball harder and farther. Press Ctrl+Shift+J to open the console and if you are on Mac command+option+J
Then write the code:
(function() {
let power = 20; // Upward thrust force
let clickMultipler = 15; // How many clicks does it launch per move console.log("--- ASCENDING PROPELLER MODE ---");
console.log("Hover your mouse over the ball to launch it into space."); document.addEventListener('mousemove', (e) => {
// We calculate a point directly below the cursor. // Clicking "below" the ball pushes it upwards.
const fakeY = e.clientY + power; for(let i = 0; i < clickMultipler; i++) {
const ev = new MouseEvent('mousedown', {
clientX: e.clientX,
clientY: fakeY,
bubbles: true,
cancelable: true,
view:window
}); // We look for the object in its current position so that the impact //counts
const target = document.elementFromPoint(e.clientX, e.clientY);
if (target) {
target.dispatchEvent(ev);
}
}
}, true);
})(); |