This site requires JavaScript, please enable it in your browser!
Greenfoot back
jlau
jlau wrote ...

2024/2/15

Getting white screen and no console errors.

jlau jlau

2024/2/15

#
Also this issue only happens after I publish. Running through the Greenfoot client works fine. Any solutions? https://www.greenfoot.org/scenarios/32849
nccb nccb

2024/2/15

#
From poking it with the Javascript debugger, it seems that the world is actually loading up, but something is going wrong. It seems that the world remains GameWorld after initialisation. I suspect the problem may be that in the constructor of GameWorld, you call Greenfoot.setWorld() to change the world. But Greenfoot's default behaviour after constructing GameWorld is to call setWorld() with the just-constructed GameWorld, which happens after you have called it, so your change of world is ignored. As it happens, the Greenfoot desktop version has some code to guard against exactly this scenario, but I think the Javascript version does not. It's not an ideal behaviour anyway; I would either just make RoundOne your starting world, or move the call to setLevel() into the started() method.
You need to login to post a reply.