恐龙游戏黑客不工作

时间:2017-05-30 15:03:22

标签: javascript console

我正在为谷歌恐龙游戏制作这个黑客:

function speed(n) {
    Runner.instance_.setSpeed(n);
}

function noHit() {
    Runner.prototype.gameOver = function() {
        console.log("");
    }
}

function notNoHit() {
    Runner.prototype.gameOver = function() {
        this.playSound(this.soundFx.HIT);
        vibrate(200);

        this.stop();
        this.crashed = true;
        this.distanceMeter.acheivement = false;

        this.tRex.update(100, Trex.status.CRASHED);
    }
}

它应该被输入到控制台中,这样你就不必编辑页面的html,这非常复杂(至少对我而言)。所以,当我输入它时,它像往常一样返回 undefined 。当我使用speed( n )时,它将速度设置为 n 。当我使用noHit()时,它就会让我无法被击中。当我说notNoHit()时,它像往常一样返回 undefined ,但当我点击一个仙人掌时,它给了我一个错误:

Uncaught RefrenceError: vibrate is not defined
    at Runner.gameOver (<anonymous>:14:3)
    at Runner.update (data:text/html,chromewebdata:2005)

这有点让我感到惊讶,因为我没有做过NoHit()的方式就是简单地将函数设置回原来的状态,而不是垃圾命令,(console.log(&#34;&#34;);)所以我不确定如何解决这个问题。

0 个答案:

没有答案
相关问题