Fixed Safari Rect rendering issue
This commit is contained in:
parent
18df8c17ec
commit
de6b327837
2
dist/es5.js
vendored
2
dist/es5.js
vendored
File diff suppressed because one or more lines are too long
2
dist/es5.js.map
vendored
2
dist/es5.js.map
vendored
File diff suppressed because one or more lines are too long
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
@ -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();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user