Fixed Safari Rect rendering issue
This commit is contained in:
parent
5a76bc6773
commit
f9d0dba07a
@ -48,9 +48,10 @@ window.onload = function () {
|
||||
|
||||
mainScene.addChildEntity(newSnowflake);
|
||||
|
||||
mainScene.children.forEach((oldSnowflake) => {
|
||||
mainScene.children.forEach(function (oldSnowflake) {
|
||||
|
||||
if (oldSnowflake.pos.y > height) {
|
||||
// Clean up snowflakes that are no longer visible
|
||||
mainScene.detachChildEntity(oldSnowflake);
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ class Game extends Entity {
|
||||
if (self._wantPause) {
|
||||
self._wantPause = false;
|
||||
} 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
|
||||
}
|
||||
|
||||
@ -165,7 +165,7 @@ class Game extends Entity {
|
||||
this._wantPause = true;
|
||||
return true;
|
||||
} 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;
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ class Rect extends Entity {
|
||||
|
||||
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);
|
||||
|
||||
return true;
|
||||
|
@ -44,7 +44,7 @@ class Sprite extends Entity {
|
||||
|
||||
render () {
|
||||
|
||||
if (this.isReady()) {
|
||||
if (this.isReady() && this._game) {
|
||||
|
||||
var imageObj = this._image.getImageObj();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user