Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ui: bugfix

  • Loading branch information...
commit 1fb88d30f9ffbaba2819a042f3087b8e6399685f 1 parent 25db55b
Fedor Indutny authored
Showing with 11 additions and 8 deletions.
  1. +1 −1  package.json
  2. +10 −7 public/javascripts/main.js
2  package.json
View
@@ -1,6 +1,6 @@
{
"name": "home",
- "version": "0.1.0",
+ "version": "0.1.1",
"private": true,
"dependencies": {
"express": "2.5.x",
17 public/javascripts/main.js
View
@@ -7,6 +7,13 @@
ctx = canvas.getContext('2d'),
socket = io.connect();
+ // No request frame in opera
+ if (!requestFrame) {
+ requestFrame = function(callback) {
+ callback();
+ };
+ }
+
ctx.fillStyle = 'black';
ctx.lineWidth = 1.5;
ctx.textAlign = 'center';
@@ -151,10 +158,8 @@
this._active = undefined;
this._current = undefined;
this._index = 0;
- this.position = undefined;
+ this.position = { x: 0, y: 0 };
this.place = 'basement';
-
- this.move({ x: 40, y: 235 });
};
Man.prototype.activate = function activate(mode) {
@@ -248,6 +253,8 @@
ghosts = [],
ghostsMap = {};
+ man.move({ x: 40, y: 235 });
+
var i = 0;
setInterval(function() {
if (i++ % 2 === 0) {
@@ -316,10 +323,6 @@
ghosts.forEach(function(ghost) {
ghost.draw();
});
-
- setTimeout(function() {
- requestFrame(draw, canvas);
- }, 5);
}, canvas);
};
Please sign in to comment.
Something went wrong with that request. Please try again.