谷歌浏览器恐龙游戏开挂秘诀
每次打開谷歌瀏覽器時(shí),我對那個(gè)小恐龍無感,只覺得小恐龍是斷網(wǎng)的標(biāo)志。一次別人打開谷歌瀏覽器,呈現(xiàn)也是令人無感的離線頁面。人卻在離線頁面上,玩起來小恐龍游戲。我當(dāng)時(shí)看到也頓時(shí)“真香”!在無意翻看手機(jī)時(shí),我居然發(fā)現(xiàn)了小恐龍開掛秘訣
永遠(yuǎn)不gameOver的兩行代碼
var dino=Runner.prototypedino.gameOver=()=>{}獲得更多獎(jiǎng)勵(lì)的一行代碼
Runner.instance_.setSpeed(數(shù)值)var dino=Runner.prototype此語句創(chuàng)建一個(gè)游戲線程類,線程類中有一個(gè)方法叫g(shù)ameOver函數(shù)。
dino.gameOver=()=>{}此語句令整個(gè)gameOver函數(shù)變?yōu)闆]有任何語句的空函數(shù)。gameOver函數(shù)名存實(shí)亡,一直保持玩家開始游戲的界面。
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函數(shù)是控制手機(jī)端和電腦端恐龍跑的速度。函數(shù)中if語句段是對手機(jī)的適配。若不對手機(jī)適配,手機(jī)界面里的恐龍那就說不好飛到哪里去了。else if語句段是對電腦適配。Runner.instance_.setSpeed(100)中數(shù)值100會(huì)傳入opt_speed變量,再進(jìn)入setSpeed函數(shù)中,恐龍移動(dòng)速度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
參考博文:
谷歌瀏覽器留下的彩蛋 “恐龍?jiān)秸系K”小游戲 ?https://blog.csdn.net/qq_43901693/article/details/104092009
js(=>) 箭頭函數(shù) 詳細(xì)解說 案例大全 ?https://www.cnblogs.com/hailun/p/6279029.html
js中[]、{}、()區(qū)別 ?https://www.cnblogs.com/mike-mei/p/11194138.html
看看程序員是怎么玩游戲的 ?https://mp.weixin.qq.com/s/WGDUyyenjKC7yiWloPBHbw
總結(jié)
以上是生活随笔為你收集整理的谷歌浏览器恐龙游戏开挂秘诀的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 三维空间的三角剖分( 3D Delaun
- 下一篇: 因特网上的英语学习资源