Chromium Code Reviews| Index: components/neterror/resources/offline.js |
| diff --git a/components/neterror/resources/offline.js b/components/neterror/resources/offline.js |
| index 79ffa5c4da8945302dbeb334c82e94d4ae0e2aff..e817591dbb72999a68a163bc2de078ad14d74036 100644 |
| --- a/components/neterror/resources/offline.js |
| +++ b/components/neterror/resources/offline.js |
| @@ -661,38 +661,40 @@ Runner.prototype = { |
| e.preventDefault(); |
|
mmenke
2017/03/20 15:11:28
Is this the right thing to do if e.target == this.
edwardjung
2017/03/21 18:51:21
Yes, as during game play you don't want to be acci
|
| } |
| - if (e.target != this.detailsButton) { |
| - if (!this.crashed && (Runner.keycodes.JUMP[e.keyCode] || |
| - e.type == Runner.events.TOUCHSTART)) { |
| - if (!this.playing) { |
| - this.loadSounds(); |
| - this.playing = true; |
| - this.update(); |
| - if (window.errorPageController) { |
| - errorPageController.trackEasterEgg(); |
| + if (!this.paused) { |
|
mmenke
2017/03/20 15:11:28
Exactly what line are you trying to skip here? I
edwardjung
2017/03/21 18:51:21
this.update();
As the delta time is calculated wh
|
| + if (e.target != this.detailsButton) { |
| + if (!this.crashed && (Runner.keycodes.JUMP[e.keyCode] || |
| + e.type == Runner.events.TOUCHSTART)) { |
| + if (!this.playing) { |
| + this.loadSounds(); |
| + this.playing = true; |
| + this.update(); |
| + if (window.errorPageController) { |
| + errorPageController.trackEasterEgg(); |
| + } |
| + } |
| + // Play sound effect and jump on starting the game for the first time. |
| + if (!this.tRex.jumping && !this.tRex.ducking) { |
| + this.playSound(this.soundFx.BUTTON_PRESS); |
| + this.tRex.startJump(this.currentSpeed); |
| } |
| } |
| - // Play sound effect and jump on starting the game for the first time. |
| - if (!this.tRex.jumping && !this.tRex.ducking) { |
| - this.playSound(this.soundFx.BUTTON_PRESS); |
| - this.tRex.startJump(this.currentSpeed); |
| - } |
| - } |
| - if (this.crashed && e.type == Runner.events.TOUCHSTART && |
| - e.currentTarget == this.containerEl) { |
| - this.restart(); |
| + if (this.crashed && e.type == Runner.events.TOUCHSTART && |
| + e.currentTarget == this.containerEl) { |
| + this.restart(); |
| + } |
| } |
| - } |
| - if (this.playing && !this.crashed && Runner.keycodes.DUCK[e.keyCode]) { |
| - e.preventDefault(); |
| - if (this.tRex.jumping) { |
| - // Speed drop, activated only when jump key is not pressed. |
| - this.tRex.setSpeedDrop(); |
| - } else if (!this.tRex.jumping && !this.tRex.ducking) { |
| - // Duck. |
| - this.tRex.setDuck(true); |
| + if (this.playing && !this.crashed && Runner.keycodes.DUCK[e.keyCode]) { |
| + e.preventDefault(); |
| + if (this.tRex.jumping) { |
| + // Speed drop, activated only when jump key is not pressed. |
| + this.tRex.setSpeedDrop(); |
| + } else if (!this.tRex.jumping && !this.tRex.ducking) { |
| + // Duck. |
| + this.tRex.setDuck(true); |
| + } |
| } |
| } |
| }, |
| @@ -812,6 +814,7 @@ Runner.prototype = { |
| this.playCount++; |
| this.runningTime = 0; |
| this.playing = true; |
| + this.paused = false; |
| this.crashed = false; |
| this.distanceRan = 0; |
| this.setSpeed(this.config.SPEED); |