How to HACK chrome dino game

How to HACK chrome dino game
Play this article

Hacking the chrome dino game is a very simple task. Believe me, god mode is fascinating but can as well be boring. This is just going to be a simple JavaScript code tweaking which will be done in the browser console. So you need a PC for this. So open Google chrome enter 'chrome:dino' into your browser's address bar then fire up your console. Let's make Dino invincible😎.

giphy (2).gif

The Dino basically make use of a Runner object. Objects are very important in any programming language. In JavaScript, objects are king. You understand objects, you understand JavaScript. The Runner object has a bunch of methods which are responsible for various states in the game. The gameOver method is actually the one responsible for ending the game when Dino collides with an obstacle.

Now I bet you know what we need to do. We need to look for a way to alter the gameOver method so it doesn't detect when Dino collides with any obstacle. This is where object prototype comes into play. All JavaScript objects inherit properties and methods from a prototype. The JavaScript prototype property also allows you to add new methods to objects constructors.

With the prototype, the gameOver method can be altered. We are just going to replace the gameOver method with an empty function so that there will be no code to handle collisions. Dino will be unstoppable. Just type the below code into a new line in your console. You can as well just copy and paste.

Runner.prototype.gameOver = function(){};

Then hit the enter key. Only modify your own prototypes. Never modify the prototypes of standard JavaScript objects.

There you have it, now start the game. H3H.gif Now Dino is unstoppable. If you love my contents then a sub to the blog would be heavenly-mrwhosetheboss.gif