diff --git a/package.json b/package.json index 943e0d3..adbfaf5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "elpy", - "version": "1.1.15", + "version": "1.1.16", "description": "2D JavaScript game engine.", "author": "space2pacman", "license": "MIT", diff --git a/src/EngineObject.js b/src/EngineObject.js index ce7bcc4..362d513 100644 --- a/src/EngineObject.js +++ b/src/EngineObject.js @@ -50,7 +50,7 @@ class EngineObject { custom: options.custom || null, color: options.color || 'black', image: { - src: (typeof options.image === 'object' && options.image !== null ? options.image.path : options.image) || null, + path: (typeof options.image === 'object' && options.image !== null ? options.image.path : options.image) || null, repeat: (typeof options.image === 'object' && options.image !== null ? options.image.repeat : false) || false, rendering: false, cached: null diff --git a/src/index.js b/src/index.js index e643b07..39c335b 100644 --- a/src/index.js +++ b/src/index.js @@ -267,7 +267,7 @@ class Engine { return new Promise(resolve => { const image = new Image(); - image.path = url; + image.src = url; image.addEventListener('load', () => { if (state) {