[web_stories title="false" excerpt="false" author="false" date="false" archive_link="true" archive_link_label="" circle_size="150" sharp_corners="false" image_alignment="left" number_of_columns="1" number_of_stories="5" order="DESC" orderby="post_title" view="circles" /]
Hacking the Dino Game From Google Chrome!
The Google Chrome web browser on Windows and macOS (most likely on Linux as well) displays a page outlining the various causes as well as a short endless runner game with a dinosaur that has to run, dodge obstacles, and accumulate points when there is no internet connection available. The game’s complexity is kept to a minimum. Cacti, clouds, dinosaurs, high scores, and current scores all appear in a monochromatic game environment. The dinosaur will have to avoid cacti, pterodactyls, and so on as the levels get more difficult. When the contrast is reversed at random, it is meant to imitate a night mode and to call the player’s attention to it, which could prove disastrous.
Chrome:/dino is a direct link to Google’s dino game while the internet is functional.
Table of Contents
Game’s Logic
Right-click on the game screen and select “Inspect” from the context menu, or press CTRL+SHIFT+I.
In the div class “runner-container,” we can see where the game code resides. The “Styles” section, which may be found in the menu on the right, displays CSS. Components for “runner-container” have been added. A debugger appears when we select “index. NUMBER” from the main menu. We have the option of pausing, stepping, running, and so forth. The debugger can be used to pause the game while we restart it. Great! “Paused in debugger” is now displayed. The debugger has also provided us with our first glimpses of the game’s internals. The “Runner” function has a lot of components that appear to be linked to the game’s logic. You can see the various parts of the “Runner” function below. The “proto” contains a function called “game over(),” among other things.
Hacking the Game
The “Inspect Element” menu item will appear once you click on it. Write the following lines in the console.
Press enter to begin the game after you’ve entered the code into the console. When the Dinosaur reaches this point, it will be able to easily evade any obstacles. Let’s go on to something more enjoyable.
— Fat Dino (@fat_dino_games) April 1, 2022
Dino Speed :
Also, let’s experiment with the game’s frame rate. To accomplish this, we use a function named “setSpeed()” that takes an integer as an argument. Our dinosaur’s speed can be altered by adjusting the value, allowing us to score more quickly. Once you reach 99999, the game resets back to zero and you must start over again.
In the console we’ll write:
This will increase the dinosaur’s speed to 6000 mph. Anything else is OK.
If you set the speed to “-1,” the dinosaur will reverse direction and the entire game scenario will move with it. LOL.
Dino Jump Limit:
The dino’s jump height is entirely within your discretion. Instead of 10, 20, 25, etc., try 10, 20, 25, etc.
Using the terminal, we can type:
Stop the Game:
As a result of the lack of a collision stop mechanism, your game will continue to run indefinitely. Using the Console is the only way to stop it.
To accomplish this, we’ll type:
When there is no internet connection, this is a fun and easy trick to try:)
Level Up Coding
Thank you for becoming a member of our family! Level Up is revolutionizing the tech industry’s hiring process. The best places to land a job are right here.
Read More:-