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

2011/7/12

Bug in Greenfoot?- Problem with .jar

1
2
supermagicmilk supermagicmilk

2011/8/13

#
You can try putting code into the started() function for the world class instead of the constructor and use a boolean variable to prevent it from loading again on pause/resume. Like so:
boolean initialize;   //will be false by default

public yourWorld(){    
        super(640,400, 1, false);                 
}

public void started(){
     if(initialize == false){
         loadStartupCode();
         initialize = true;
     }
}
This fixed a bug I found in my own code earlier where the game would not load when I called Greenfoot.setSpeed() in the constructor, but this method let's me do basically the same thing.
GameCode GameCode

2011/9/10

#
Just downloaded version 2.1.1 and created some .jar There are no black squares anymore and everything works fine. Thank you very much for this new Version of Greenfoot =D
You need to login to post a reply.
1
2