0% found this document useful (0 votes)
81 views

Hack For Dino Run Game

The document provides instructions for modifying the gameplay of Chrome Dino by making the dinosaur immortal, changing its speed and score, controlling jump height, allowing it to walk in air, and setting up auto-play functionality to jump or duck based on obstacle positions.
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views

Hack For Dino Run Game

The document provides instructions for modifying the gameplay of Chrome Dino by making the dinosaur immortal, changing its speed and score, controlling jump height, allowing it to walk in air, and setting up auto-play functionality to jump or duck based on obstacle positions.
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

Immortality (God mode)

Follow the commands to make the Dino un-killable.

We store the original game over function in a variable. This step is IMPORTANT if
you want to stop the game later and needs to be done before you reset the gameOver
function.

var original = Runner.prototype.gameOver


Then, we make the game over function empty:

Runner.prototype.gameOver = function(){}

How to stop?
When you want to stop the game, Revert back to the original game over function.
This would only work if you had entered both commands in order for Immortality.

Runner.prototype.gameOver = original

Tweaking Speed
Type the following command in Console and press enter. You can use any other speed
in place of 1000.

Runner.instance_.setSpeed(1000)
To go back to normal speed:

Runner.instance_.setSpeed(10)

Setting the current score


Let’s set the score to 12345. You can set any other score less than 99999. The
current score is reset on game over.
Runner.instance_.distanceRan = 12345 /
Runner.instance_.distanceMeter.config.COEFFICIENT

Jumping height
You can control how high the dino jumps by using the below function. Adjust the
value as necessary.

Runner.instance_.tRex.setJumpVelocity(10)

Walk in air
Chrome Dino walking in air

Runner.instance_.tRex.groundYPos = 0
Back to ground:

Runner.instance_.tRex.groundYPos = 93

Auto-play
This code periodically checks for the closest obstacle (cactus or pterodactyl) and
then jumps or ducks based on the obstacle’s position.

function dispatchKey(type, key) {


document.dispatchEvent(new KeyboardEvent(type, {keyCode: key}));
}
setInterval(function () {
const KEY_CODE_SPACE_BAR = 32
const KEY_CODE_ARROW_DOWN = 40
const CANVAS_HEIGHT = Runner.instance_.dimensions.HEIGHT
const DINO_HEIGHT = Runner.instance_.tRex.config.HEIGHT

const obstacle = Runner.instance_.horizon.obstacles[0]


const speed = Runner.instance_.currentSpeed

if (obstacle) {
const w = obstacle.width
const x = obstacle.xPos // measured from left of canvas
const y = obstacle.yPos // measured from top of canvas
const yFromBottom = CANVAS_HEIGHT - y - obstacle.typeConfig.height
const isObstacleNearby = x < 25 * speed - w / 2

if (isObstacleNearby) {
if (yFromBottom > DINO_HEIGHT) {
// Pterodactyl going from above, do nothing
} else if (y > CANVAS_HEIGHT / 2) {
// Jump
dispatchKey("keyup", KEY_CODE_ARROW_DOWN)
dispatchKey("keydown", KEY_CODE_SPACE_BAR)
} else {
// Duck
dispatchKey("keydown", KEY_CODE_ARROW_DOWN)
}
}
}
}, Runner.instance_.msPerFrame);

You might also like