This is my world code:
The problem is that Greenfoot.start() doesn't work all the time. The start/pause button shows "Pause" when i compile, but the actors only act two out of three times. Sometimes it works if i use the reset button or if i compile again. So is this a bug or am i doing something wrong. I'm not sure if "public myWorld" is the right place to put the code, or if this is even possible. Oh, I forgot to mention that what I want the program to do is to "run" on execute, so the user doesn't need to click the run button.
Thank you for your time.
1 2 3 4 5 6 7 8 9 10 11 | public myWorld() { // Create a new world with 600x400 cells with a cell size of 1x1 pixels. super ( 6 , 6 , 60 ); setPaintOrder(Introduction. class , CompleteScreen. class , ResetLevel. class , Player. class , Rock. class , Orange. class , Grass. class ); prepare(); Greenfoot.start(); } |