Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Unified Diff: components/neterror/resources/offline.js

Issue 2140543003: Workaround for displaying the Trex at the beginning (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rex
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/neterror/resources/offline.js
diff --git a/components/neterror/resources/offline.js b/components/neterror/resources/offline.js
index 5fa3050629dc6da4bc2fbd02e01081f3dcef2edd..f18fff496d412adb27ade610b27ce486064645e3 100644
--- a/components/neterror/resources/offline.js
+++ b/components/neterror/resources/offline.js
@@ -1496,6 +1496,8 @@ function Trex(canvas, spritePos) {
this.jumpCount = 0;
this.jumpspotX = 0;
+ this.count = 0;
+
this.init();
};
@@ -1633,6 +1635,13 @@ Trex.prototype = {
}
}
+ // Count to 3: once at the Trex creation, once at the runner.update() and
+ // once for the first frame update using requestAnimationFrame
+ if(this.count < 3) {
+ this.count++;
+ this.draw(0, 0);
+ }
+
// Game intro animation, T-rex moves in from the left.
if (this.playingIntro && this.xPos < this.config.START_X_POS) {
this.xPos += Math.round((this.config.START_X_POS /
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698