Can't change background image


(Simon Birrer) #1

Hello everyone,

I’m using melonJS to create a game. I have first set a background some time ago, and it worked wonderful. Now, I other backgrounds and want to change the picture in the imageLayer, but after I change the picture the game won’t load. Start screen appears, and I can hit enter to start the game, but the the browser stops loading and I’m left with a empty white screen.

The weird part about that error is that I can use the old background and the game will work, but any other picture won’t. It seems just adding the new picture as background and removing it will cause the game to stop loading.

I’m using this tutorial for making the game:
http://melonjs.github.io/tutorial-platformer/
I fail at point 4, obviously: Adding a scrolling background.

With this google drive link down below you can find two pictures:
background.png (this is the file that works as background)
sunset.png (picutre that I want to use as the new background but doesn’t work)

Mentioned google drive link:
https://drive.google.com/open?id=1m2brVTVLaCSWTu4CwQATNDDprYkgkkwj

Does anyone know where I go wrong?