Last active
September 12, 2021 18:57
-
-
Save gornostay25/3889cfad924b1f85231a867a95be8295 to your computer and use it in GitHub Desktop.
Chrome Dino slows down but doesn't die
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Paste this code into console (CTRL+Shift+I / F12) | |
function customGameOver(){ | |
let timer; | |
return ()=>{ | |
clearTimeout(timer); | |
timer = setTimeout(()=>{ | |
this.playSound(this.soundFx.HIT); | |
let csp = this.currentSpeed; | |
if (csp/2 < 4){ | |
this.setSpeed(4); | |
}else{ | |
this.setSpeed(csp/2); | |
} | |
},25); | |
} | |
} | |
Runner.prototype.gameOver = customGameOver.apply(Runner.instance_); | |
//to restart | |
// Runner.prototype.restart.apply(Runner.instance_); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment