1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > 谷歌Chrome小恐龙代码(自动跳 高跳 无敌 加速)

谷歌Chrome小恐龙代码(自动跳 高跳 无敌 加速)

时间:2021-09-15 00:30:03

相关推荐

谷歌Chrome小恐龙代码(自动跳 高跳 无敌 加速)

目录

自动跳代码

无敌代码

高跳代码(可以改括号内参数)

疾跑代码(可以改括号内参数)

大多数浏览器都有自己的彩蛋,而今天我们分享的是谷歌Chrome

谷歌小恐龙游戏是一个浏览器自带的小游戏。

断网联网状态都是可以玩的

那么如何在联网的状态下进行游戏呢?

首先打开谷歌Chrome,在地址栏输入:chrome://dino/

开整

自动跳代码:

function TrexRunnerBot() {const makeKeyArgs = (keyCode) => {const preventDefault = () => void 0; return {keyCode, preventDefault}; };const upKeyArgs = makeKeyArgs(38); const downKeyArgs = makeKeyArgs(40); const startArgs = makeKeyArgs(32);if (!Runner().playing) {Runner().onKeyDown(startArgs); setTimeout(() => {Runner().onKeyUp(startArgs); }, 500); }function conquerTheGame() {if (!Runner || !Runner().horizon.obstacles[0]) return;const obstacle = Runner().horizon.obstacles[0];if (obstacle.typeConfig && obstacle.typeConfig.type === 'SNACK') return;if (needsToTackle(obstacle) && closeEnoughToTackle(obstacle)) tackle(obstacle); }function needsToTackle(obstacle) {return obstacle.yPos !== 50; }function closeEnoughToTackle(obstacle) {return obstacle.xPos <= Runner().currentSpeed * 18; }function tackle(obstacle) {if (isDuckable(obstacle)) {duck(); } else {jumpOver(obstacle); }}function isDuckable(obstacle) {return obstacle.yPos == 75; }function duck() {drop(); Runner().onKeyDown(downKeyArgs);setTimeout(() => {Runner().onKeyUp(downKeyArgs); }, 500); }function drop() {Runner().onKeyDown(downKeyArgs);Runner().onKeyUp(downKeyArgs); }function jumpOver(obstacle) {if (isNextObstacleCloseTo(obstacle))jumpFast(); elseRunner().onKeyDown(upKeyArgs); }function isNextObstacleCloseTo(currentObstacle) {const nextObstacle = Runner().horizon.obstacles[1];return nextObstacle && nextObstacle.xPos - currentObstacle.xPos <=Runner().currentSpeed * 42; }function jumpFast() {Runner().onKeyDown(upKeyArgs); Runner().onKeyUp(upKeyArgs); }return {conquerTheGame: conquerTheGame}; }let bot = TrexRunnerBot(); let botInterval = setInterval(bot.conquerTheGame, 2);

无敌代码:

Runner.instance_.gameOver=function(){}

高跳代码(可以改括号内参数):

Runner.instance_.tRex.setJumpVelocity(20)

疾跑代码(可以改括号内参数):

Runner.instance_.setSpeed(50)

大家都明白了吗,有问题到评论区评论哦~

快在信息课的时候给别人炫耀炫耀吧

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。