Skip to content

Hackiez/Dino-Game-Hack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Dino-Game-Hack

This JavaScript snippet allows you to override the Chrome Dinosaur game’s gameOver function so that the game only ends when a specific score is reached. Until that score is reached, the dinosaur can keep running without dying.

Made by ChatGPT.

Features

  • Set a target score at which the game will end.
  • Prevents the game from ending prematurely.
  • Works directly in the browser console.

Usage

  1. Open the Chrome Dinosaur game (chrome://dino) in your browser.
  2. Open Developer Tools:
    • Press F12 or Ctrl+Shift+I (Windows/Linux)
    • Press Cmd+Option+I (Mac)
  3. Go to the Console tab.
  4. Copy and paste the following code:
// Set your target score here
const targetScore = 1000;

// Save the original gameOver function
const originalGameOver = Runner.instance_.gameOver;

// Override gameOver temporarily based on score
Runner.instance_.gameOver = function() {
    const currentScore = Runner.instance_.distanceMeter.digits.join('') * 1; // convert digits to number
    if (currentScore >= targetScore) {
        // Call original gameOver if score reached
        originalGameOver.call(this);
    } else {
        // Otherwise, do nothing (keep playing)
        console.log(`Score ${currentScore} not yet ${targetScore}, keep playing!`);
    }
};
Press Enter to activate the override.

Play the game! The game will only end when the target score is reached.

Customization
Change the value of targetScore to any number you want. Example:

javascript
Copy code
const targetScore = 5000; // Game ends at 5000 points
Notes
This code works only in the Chrome Dinosaur game.

It modifies the game’s internal gameOver function and may not work if the game version changes.

To restore normal behavior, refresh the page.

License
This project is released under the MIT License.

Credit: Code generated by ChatGPT.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published