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

2023/12/20

Game works in Greenfoot, but not web browser

NonBinaryProgrammer NonBinaryProgrammer

2023/12/20

#
My game runs as described in greenfoot, but does not work properly when trying to play it in the web browser (it stops running as soon as you select a difficulty). Is there a known fix/workaround for this? My source code is available on the scenario page.
nccb nccb

2023/12/20

#
There's two possibilities. One is that another user found in the past the online version seems to have trouble with inner enums, so you could try moving the enums to top-level classes. But before you do that, I notice a peculiarity: the "RandyRandom$wishlist.class" file is wrongly named. It should be "RandyRandom$Wishlist.class". (Long story, but Windows is case-preserving while being case-insensitive, so this can happen if you first name the enum "wishlist" then later rename to "Wishlist".) Maybe try deleting RandyRandom$wishlist.class (make sure not to delete any Java files!) then in Greenfoot go to Tools->Recompile scenario and try uploading it again. If that doesn't work, instead try moving the enum to the top-level.
Thank you for responding, moving the enum to the top-level worked. I did not try deleting the wishlist file because I am on mac so I wasn't sure if your advice would work.
You need to login to post a reply.