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

2023/5/18

Trying to get the physics in my platformer right

1
2
Nextonic Nextonic

2023/5/21

#
I realized it was println like right after i posted that thank u so much for the fix. I ran into another problem with the read method. Theres two of them. Which one should i replace. I deleted both of them and used ur read method, but then I got a problem with the .close() in line 18 & 19
Nextonic Nextonic

2023/5/21

#
I fixed it with a try/catch statement, but all im getting are does not exist error and a null pointer Looks something like this java.lang.RuntimeException: The gif file "images/RunRight.gif" doesn't exist. at GifImage$GifDecoder.read(GifImage.java:532) at GifImage.loadImages(GifImage.java:125) at GifImage.<init>(GifImage.java:39) at character.<init>(character.java:11) at MyWorld.<init>(MyWorld.java:16) 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 greenfoot.core.Simulation.newInstance(Simulation.java:580) at greenfoot.platforms.ide.WorldHandlerDelegateIDE.lambda$instantiateNewWorld$0(WorldHandlerDelegateIDE.java:143) 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) java.lang.NullPointerException at GifImage.getCurrentImage(GifImage.java:111) at character.act(character.java:20) at greenfoot.core.Simulation.actActor(Simulation.java:567) at greenfoot.core.Simulation.runOneLoop(Simulation.java:530) at greenfoot.core.Simulation.runContent(Simulation.java:193) at greenfoot.core.Simulation.run(Simulation.java:183)
danpost danpost

2023/5/22

#
Nextonic wrote...
Looks something like this java.lang.RuntimeException: The gif file "images/RunRight.gif" doesn't exist.
Double check the file name and suffix. All characters must be in the proper upper/lower case.
You need to login to post a reply.
1
2