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

2013/5/18

new World in .jar application

Ragtime Ragtime

2013/5/18

#
Hi, I'm using the following code in order to change the World in my game
public void nextlevel(World level)
    {
        play=false;
        if(Greenfoot.isKeyDown("space"))
        {
            play=true;
            Greenfoot.setWorld(level);
        }
    }
This works as long as I open the game in Greenfoot, but as soon as I export it it just stops running instead of changing the world. This happens only with some of my worlds, some others work. What could be the reason and what could I do to resolve the problem? Thanks.
jonguan jonguan

2016/11/24

#
I had the same problem, and I figured that there is an error in the exporter, where it doesn't also bundle external .jar libraries as well. The libraries in question for me:
import java.net.* ;
import org.json.* ;
import com.fasterxml.jackson.databind.*;
import org.restlet.resource.*;
import org.restlet.representation.* ;
import org.restlet.ext.json.* ;
import org.restlet.data.* ;
import org.restlet.ext.jackson.*;
I suspect that any external libraries are not being packaged into the jar
You need to login to post a reply.