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

2023/11/10

Game works in Greenfoot but not on in Browser

BenZim BenZim

2023/11/10

#
Dear Greenfoot community, I just uploaded my first game and I really don´t know, why it doesn´t work when I upload it. You can download the game and check the source code. I deleted all static sound objects already, because they gave me a runtime error. I really don´t know what to change to make it work in the browser. It would be great if you could help me! Thank you in advance. Here is the game: https://www.greenfoot.org/scenarios/32346 Edit: The startscreen works, but seems to be much slower in Firefox than in Edge
nccb nccb

2023/11/15

#
Something odd is indeed happening with that scenario. Looking at the source code, it seems it has failed to convert some part of the code. As far as I can tell, it's do with the Swisher class. The only unique thing about that class is the inner Event enum. I wonder if the translation to Javascript is getting confused by the inner class. Try changing Event to a top-level class (rather than inner class) and see if that helps.
BenZim BenZim

2023/11/22

#
Thank you so much for looking into my code, nccb! I reworked the whole project and replaced the enum by an int. The game works now, but the font is changed to a serif font (i used "SansSerif"), my graphic animations (scale) are blurry now and it works really slow on the firefox browser, while edge is playing in normal time.
You need to login to post a reply.