Welcome folks today in this blog post we will be looking how to hack and automate chrome dinosaur game in browser using javascript. All the source code of the example will be shown below.
What is Chrome Dinosaur Game??
As you know guys when the internet is gone there is thing popular game when you open the chrome browser and when you click the spacebar key on keyword then this dino start running endlessly and you have to play this game tackling the different obstacles which come you need to survive and achieve some score. As game goes on the speed of dinosaur increases and it becomes difficult to play. In this tutorial we will see how to automate and hack this game to achieve unlimited score. And also you can control the speed of the dinosaur also so that it will not increase as the games on. So let’s look how to do this in the browser using some cool javascript.
Hacking and Automating Chrome Dinosaur Game
Now first of all you need to go to browser console by right clicking the mouse and click on inspect element and then dev tools will open on the right hand side you need to go to console area as shown below
Making Dinosaur never die
Now guys we will see how we can make the dinosaur never die by copy pasting simple javascript function inside the browser console
1 2 3 |
var dummy = Runner.prototype.gameOver Runner.prototype.gameOver = function(){ } |
You just need to copy paste this code inside the console and enter then see the magic your score will increase automatically and the dinosaur will never die. Your game will be fully automated
Controlling the Speed of Dinosaur
Now we will look on how to control the speed of dinosaur so that it doesn’t increase as the game goes on. It stays at a fixed value and not increase. We can do this by simple javascript function which is shown below
1 |
Runner.instance_.setSpeed(6000) |
You can pass any value inside the above code.
Controlling the Jump of Dinosaur
Now we will look at how we can control the jump range of the dino in the game. It will also stay at a fixed value which you provide inside the javascript function. So just copy paste the below code in the console and see the magic
1 |
Runner.instance_.tRex.setJumpVelocity(10) |
Here you can pass any value and it will control the jumping velocity of the dinosaur
Stop the Chrome Dinosaur Game
Now at last we will see how to stop the game if you are bored it is very simple in javascript. The function is shown below
1 |
Runner.prototype.gameOver = dummy |