Hi,
sorry but I have another question:
I want Greenfoot to do nothing until a Key is pressed. How can i realise it?
Thx for help:)


Key k1 = "space"; while(getKey() != k1){ }
//in your act method if (theBooleanForTheWorldChangingCondition) { if (Greenfoot.isKeyDown("space")) { theBooleanForTheWorldChangingCondition = false; //you should use a shorter name I think; setWorld(theOtherWorld);//the command you used before to change the world; } }
// add this boolean to the class boolean waitingForSpaceKey = false; // to be used as a flag // in the 'if' block that determines intersection waitingForSpaceKey = true; // sets flag // in the 'act' method if (waitingForSpaceKey) // catches flag { if (Greenfoot.isKeyDown("space")) // check for 'space' { waitingForSpaceKey = false; // clears flag Greenfoot.setWorld(new WorldName()); // changes world } return; // just waiting for keypress }
if (WorldName.actorsHalted) return;
if(isKeyDown("n"){ }
if(isKeyDown("space"){ }