Jump to content

failed to load image


Recommended Posts

i'm trying to load image on phaser 3 but on chrome consol says failed to load image also search for it, change code but can't solve it. here is my js code


var config = {
    type: Phaser.AUTO,
    width: 800,
    height: 600,
    physics: {
        default: 'arcade',
        arcade: {
            gravity: {y: 500},
            debug: false
    scene: {
        preload: preload,
        create: create,
        update: update
var game = new Phaser.Game(config);

function preload() {
function create() {
    this.add.image(400, 300, 'sky');
function update() {


Link to comment
Share on other sites

If your file structure is like this

GameFolder {
    Assets {
    Src {

then your load should be this


//if you have another folder layout its like so 
this.load.image('sky', 'assets/levels/lvl1/sky.png');

All your javascript should be inside src and all you audio video images etc inside assets

Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...