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

2020/1/17

java lang runtime exception

Manu3lll Manu3lll

2020/1/17

#
My Game I need help with this java exception. Into Greenfoot the problem does not appear. The link above shows my game which throws the error.
Archerfish Archerfish

2020/1/17

#
Hey Manu3lll! Do you happen to have global or sound variables in your world? Sometimes these can cause issues when uploading. I cannot be sure of the problem though, is it possible for you to re-upload the scenario with the source code?
Manu3lll Manu3lll

2020/1/17

#
Hey, I do not have any sound variables but I am playing sound through "Greenfoot.playSound("file")". I uploaded the scenario with the source code.
Archerfish Archerfish

2020/1/17

#
Ok, so I think I have found the problem. The declaration and initialization statements: private static Leben leben1 = new Leben(); private static Leben leben2 = new Leben(); private static Leben leben3 = new Leben(); private static Gegner gegner1 = new Gegner(); private static Gegner gegner2 = new Gegner(); private static Gegner gegner3 = new Gegner(); private static Gegner gegner4 = new Gegner(); private static Gegner gegner5 = new Gegner(); private static Gegner gegner6 = new Gegner(); I don't know why, but the online version of Greenfoot tends to have issues with static variables. In this case, the upload will run if you move the initializations to the World Constructor.
Manu3lll Manu3lll

2020/1/18

#
Okay, yeah this could be the Problem. Thank you, I will fix it :)
Manu3lll Manu3lll

2020/1/18

#
Thank you very much for you help, it worked.
You need to login to post a reply.