Fixed Safari Rect rendering issue

This commit is contained in:
Nathan Kunicki 2015-12-23 16:41:46 +00:00
parent 5a76bc6773
commit f9d0dba07a
4 changed files with 6 additions and 5 deletions

View File

@ -48,9 +48,10 @@ window.onload = function () {
mainScene.addChildEntity(newSnowflake); mainScene.addChildEntity(newSnowflake);
mainScene.children.forEach((oldSnowflake) => { mainScene.children.forEach(function (oldSnowflake) {
if (oldSnowflake.pos.y > height) { if (oldSnowflake.pos.y > height) {
// Clean up snowflakes that are no longer visible
mainScene.detachChildEntity(oldSnowflake); mainScene.detachChildEntity(oldSnowflake);
} }

View File

@ -108,7 +108,7 @@ class Game extends Entity {
if (self._wantPause) { if (self._wantPause) {
self._wantPause = false; self._wantPause = false;
} else { } else {
console.log("MomentumEngine.Game.start called, game instance is already started"); console.log("MomentumEngine.Classes.Game.start called, game instance is already started");
return false; // Game is already running return false; // Game is already running
} }
@ -165,7 +165,7 @@ class Game extends Entity {
this._wantPause = true; this._wantPause = true;
return true; return true;
} else { } else {
console.log("MomentumEngine.Game.pause called, game instance is already paused"); console.log("MomentumEngine.Classes.Game.pause called, game instance is already paused");
return false; return false;
} }
} }

View File

@ -32,7 +32,7 @@ class Rect extends Entity {
if (this._game) { if (this._game) {
this._game.context.fillStyle = this.color; this._game.context.fillStyle = this.color.toString();
this._game.context.fillRect(this._calculatedPos.x, this._calculatedPos.y, this.size.x, this.size.y); this._game.context.fillRect(this._calculatedPos.x, this._calculatedPos.y, this.size.x, this.size.y);
return true; return true;

View File

@ -44,7 +44,7 @@ class Sprite extends Entity {
render () { render () {
if (this.isReady()) { if (this.isReady() && this._game) {
var imageObj = this._image.getImageObj(); var imageObj = this._image.getImageObj();