I’m new to Phaser (and bundlers like Parcel) and have worked through some of the code examples online. Many great code samples are available on codesandbox.io, though I’ve found that often the samples don’t run well when I download the source and try running locally.
Here is one example: [frog adventure template]. The sandbox specifies the environment as “Parcel”. After downloading the source I’m able to launch on my own machine by running the following commands from the base directory (frog-adventure-template):
npm install
npm run start
The sample launches in my browser, but the images are not rendered as seen in the screenshot above.
The preload() method from Game.js attempts to load the images as follows:
this.load.image("background", "assets/background.png");
this.load.image("platform", "assets/platform.png");
this.load.image("rock", "assets/rock.png");
I’ve tried modifying the path to be a relative path from the base directory (‘./assets/background.png’) and alternatively a relative path from Game.js (./…/…/assets/background.png), though both to no avail. Any thoughts on what the issue may be?