Last active
February 8, 2017 01:20
-
-
Save adriancooney/5b65ce6246d13dffb25deea0b0d67db1 to your computer and use it in GitHub Desktop.
Cheat in Chrome's "No network connection" dinosaur game. Paste this in the console when you find yourself on the screen (or disconnect from the internet and attempt to load a page).
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
const update_ = Runner.instance_.update; | |
Runner.instance_.update = function() { | |
if(this.horizon.obstacles.length) { | |
const nearestObstacle = this.horizon.obstacles[0]; | |
if(nearestObstacle.xPos < 115 && !this.tRex.jumping) { | |
if(nearestObstacle.yPos <= 50) { | |
this.tRex.setDuck(true); | |
setTimeout(this.tRex.setDuck.bind(this.tRex, false), 500); | |
} else { | |
this.tRex.startJump(this.currentSpeed); | |
} | |
} | |
} | |
update_.call(this); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment