Skip to content

Instantly share code, notes, and snippets.

@adriancooney
Last active February 8, 2017 01:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adriancooney/5b65ce6246d13dffb25deea0b0d67db1 to your computer and use it in GitHub Desktop.
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).
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