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

2020/3/18

Need help with "instantiate a new world object"

ThomasGaldieri ThomasGaldieri

2020/3/18

#
I made a game in high school and I tried moving the files for the game over to my MacBook Pro. I downloaded the Mac version of Greenfoot and I copy and pasted all of the code into Greenfoot and titled it accordingly. I compile everything and I have "no errors" however the game will simply not load up on the screen. I do have music for the game and it is also not working. However, I do have the same music downloaded onto my computer.
GrucifyMe GrucifyMe

2020/3/18

#
I have a Windows laptop, and sometimes when I click "Compile", it presents no errors, however, a new tab called "Window" opens up and shows me where all I have made errors, like for example, if some value is null. Remember, when you compile the code, it quick checks your code to make sure your syntax is proper, and notifies you of basic errors. So maybe, you don't have such a window like me popping up. This could potentially be the problem, but I don't know for sure. Another could be the file name. Sometimes a file name on your laptop storage might have been misspelled, causing the other programs to fail like Dominos. Again, I don't know for sure, so please refer to other people too. Hope this helps!
ThomasGaldieri ThomasGaldieri

2020/3/18

#
When I click on "MyWorld" and then hit "NewMyWorld" I get this error code thing. Do you know what this means? java.lang.IllegalArgumentException: Could not open sound file: When rushjet1 and danooct1 get bored.wav at greenfoot.sound.SoundExceptionHandler.handleIOException(SoundExceptionHandler.java:66) at greenfoot.sound.SoundFactory.createSound(SoundFactory.java:120) at greenfoot.GreenfootSound.<init>(GreenfootSound.java:54) at MyWorld.<init>(MyWorld.java:13) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) at bluej.runtime.ExecServer$3.lambda$run$1(ExecServer.java:834) at bluej.runtime.ExecServer.lambda$runOnTargetThread$1(ExecServer.java:939) at greenfoot.core.Simulation.runQueuedTasks(Simulation.java:470) at greenfoot.core.Simulation.maybePause(Simulation.java:299) at greenfoot.core.Simulation.runContent(Simulation.java:190) at greenfoot.core.Simulation.run(Simulation.java:183) Caused by: java.io.FileNotFoundException: Could not find file: When rushjet1 and danooct1 get bored.wav at greenfoot.util.GreenfootUtil.getURL(GreenfootUtil.java:189) at greenfoot.sound.SoundFactory.createSound(SoundFactory.java:99) ... 12 more Also thank you very much for the help, I am not really sure what to do with the information but I appreciate the help regardless.
danpost danpost

2020/3/18

#
It could be something as simple as having spaces in your sound file name(s) that is causing the issue. I would, first, try re-naming the file (the current error is with When rushjet1 and danooct1 get bored.wav).
ThomasGaldieri ThomasGaldieri

2020/3/22

#
I renamed the sound file to "Intense 8 bit muisc.wav" and something that I have not seen before showed up at the bottom of my screen. It says java.lang.IllegalArgumentException: Could not open sound file: Intense 8 bit music.wav (in greenfoot.sound.SoundExceptionHandler) I did remember to change the name in both the folder with the music as well as within Greenfoot. Thank you very much for the help :)
ThomasGaldieri ThomasGaldieri

4 days ago

#
does anybody know what this means? java.lang.IllegalArgumentException: Could not open sound file: Intense 8 bit music.wav (in greenfoot.sound.SoundExceptionHandle
yeeterboi420 yeeterboi420

4 days ago

#
it means that the sound file that you are trying to play doesn't exist, you have to name it something else (i think) or make sure that there are no errors in your naming.
You need to login to post a reply.