我们大多数人都看到过恐惧“No Internet”Chrome浏览器上的错误消息。实际上,您可以将这个屏幕变得有趣, 以恐龙为主题的无尽亚军游戏 和, even better, hack it to where your dinosaur becomes invincible. 这里’s how.
如何玩隐藏的Google Chrome恐龙游戏
如果你 不要’没有互联网连接,那你别’不必做任何特别的事情。只需在Google Chrome浏览器地址栏中输入任何URL,您便可以’ll see this screen.
如果你 做 have an internet connection, you can access this page without cutting the connection. Type chrome://dino
in the address bar, 和 it will take you there.
一旦您’ve made your way to this screen, you can start the game by pressing the space bar. 一旦您 做 , the dinosaur will begin running. The object of the game is to avoid whatever comes your way, such as birds 和 cacti. Once the dinosaur gets hit by a bird or runs into a cactus, it’s game over.
这是一种消磨时间的好方法,而且’尝试突破自己的高分总是很有趣的。随着您的继续,游戏难度会增加。它’想一想,有史以来获得的最高分数是什么,而没有作弊,这很有趣,这使我们进入了下一个要点。
破解Google Chrome恐龙游戏
这种技巧可以使您的恐龙变得无敌,让玩家继续游戏而不必担心被戳或啄。
要破解游戏,您’我需要在“No Internet” screen, so go ahead 和 enter chrome://dino
in the address bar. Once there, right-click anywhere on the screen 和 select “Inspect”从出现的菜单中。
这打开 Chrome DevTools,显示在浏览器窗口的右侧。在DevTools中,选择“Console” tab.
或者,您可以按Ctrl + Shift + I并直接跳到“Console”Chrome DevTools中的标签。
一旦进入“Console”选项卡,粘贴以下命令,然后按“Enter” key:
var original = Runner.prototype.gameOver
这似乎无济于事,但我们’ll解释为什么这是必要的。
接下来,输入以下命令:
Runner.prototype.gameOver = function (){}
On the next line, f (){}
will appear after pressing the “Enter” key.
这里’现在发生了什么。游戏结束时(例如,您击中一个对象),将调用Runner.prototype.gameOver()并触发操作。在这种情况下,您’会听到声音,游戏停止,并且出现游戏结束消息。那’s without our code.
我们的代码所做的是用一个空函数替换gameOver函数。这意味着没有听到声音,没有停止游戏,没有出现消息,而是什么也没有发生。你只是继续跑步。
测试一下。关闭DevTools,然后按空格键开始玩游戏。
如您所见,恐龙不受仙人掌或飞行生物的影响。任务完成。
现在,让’s say you’玩了25分钟,您想停止比赛并记录下您的高分。您’我们将需要一种结束游戏的方法,这种方法再也不用碰到仙人掌了。
Remember the first code we entered? That stored the normal gameOver
function in the original
variable. That means we can now execute this command to use the normal gameOver
function:
Runner.prototype.gameOver = original
如果你’re interested, you can (see 2) look at what is supposed to happen when the normal gameOver
function is called.