谷歌浏览器恐龙游戏开挂秘诀
每次打開谷歌瀏覽器時,我對那個小恐龍無感,只覺得小恐龍是斷網的標志。一次別人打開谷歌瀏覽器,呈現也是令人無感的離線頁面。人卻在離線頁面上,玩起來小恐龍游戲。我當時看到也頓時“真香”!在無意翻看手機時,我居然發現了小恐龍開掛秘訣
永遠不gameOver的兩行代碼
var dino=Runner.prototypedino.gameOver=()=>{}獲得更多獎勵的一行代碼
Runner.instance_.setSpeed(數值)var dino=Runner.prototype此語句創建一個游戲線程類,線程類中有一個方法叫gameOver函數。
dino.gameOver=()=>{}此語句令整個gameOver函數變為沒有任何語句的空函數。gameOver函數名存實亡,一直保持玩家開始游戲的界面。
gameOver: function() {this.playSound(this.soundFx.HIT);vibrate(200);this.stop();this.crashed = true;this.distanceMeter.achievement = false;this.tRex.update(100, Trex.status.CRASHED);// Game over panel.if (!this.gameOverPanel) {if (this.canvas) {this.gameOverPanel = new GameOverPanel(this.canvas,this.spriteDef.TEXT_SPRITE, this.spriteDef.RESTART,this.dimensions);}} else {this.gameOverPanel.draw();}// Update the high score.if (this.distanceRan > this.highestScore) {this.saveHighScore(this.distanceRan);}// Reset the time clock.this.time = getTimeStamp();}?setSpeed函數是控制手機端和電腦端恐龍跑的速度。函數中if語句段是對手機的適配。若不對手機適配,手機界面里的恐龍那就說不好飛到哪里去了。else if語句段是對電腦適配。Runner.instance_.setSpeed(100)中數值100會傳入opt_speed變量,再進入setSpeed函數中,恐龍移動速度100(單位,我沒弄明白說不好)
setSpeed: function(opt_speed) {const speed = opt_speed || this.currentSpeed;// Reduce the speed on smaller mobile screens.if (this.dimensions.WIDTH < DEFAULT_WIDTH) {const mobileSpeed = speed * this.dimensions.WIDTH / DEFAULT_WIDTH *this.config.MOBILE_SPEED_COEFFICIENT;this.currentSpeed = mobileSpeed > speed ? speed : mobileSpeed;} else if (opt_speed) {this.currentSpeed = opt_speed;}}拓展閱讀
谷歌小恐龍修改無敵刷分??https://blog.csdn.net/qq_19659617/article/details/104009452
google chrome瀏覽器離線小恐龍游戲刷分bug??https://blog.csdn.net/z_qifa/article/details/74202863
參考博文:
谷歌瀏覽器留下的彩蛋 “恐龍越障礙”小游戲 ?https://blog.csdn.net/qq_43901693/article/details/104092009
js(=>) 箭頭函數 詳細解說 案例大全 ?https://www.cnblogs.com/hailun/p/6279029.html
js中[]、{}、()區別 ?https://www.cnblogs.com/mike-mei/p/11194138.html
看看程序員是怎么玩游戲的 ?https://mp.weixin.qq.com/s/WGDUyyenjKC7yiWloPBHbw
總結
以上是生活随笔為你收集整理的谷歌浏览器恐龙游戏开挂秘诀的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 三维空间的三角剖分( 3D Delaun
- 下一篇: 因特网上的英语学习资源