We are going to store all our game assets locally, and our game is going to be running fully offline. Let's look at how we can render the background images:
- Create a new assets folder in the project root so that you have somewhere to store your files.
- After that, find and download a beautiful space picture, like the one shown in the following screenshot:
You can find the preceding background image in this book's GitHub repository: https://github.com/PacktPublishing/Electron-Projects/blob/master/Chapter05/assets/background.jpg.
- Save it as an assets/background.jpg file.
- Update the preload function and set the base URL to the local application folder. Then, fetch the background image. Here, we're giving it the background key. Use the following code to reference this image:
function preload() {
this.load.setBaseURL(&apos...