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

2014/9/6

cant find variable myWorld, im trying to add a game over screen

roshiyoshi roshiyoshi

2014/9/6

#
{ World world; world=getWorld(); GameOver gameover= new GameOver(); myWorld.addObject(gameover, myWorld.getWidth()/2, myWorld.getHeight()/2); world.removeObject(fish); }
danpost danpost

2014/9/6

#
This is because you named your world variable 'world', not 'myWorld'. Change all occurrences of 'myWorld' to 'world'.
roshiyoshi roshiyoshi

2014/9/6

#
thank you, why does the "game over" pop up as soon as i press run rather than when the fish is eaten?
danpost danpost

2014/9/6

#
roshiyoshi wrote...
thank you, why does the "game over" pop up as soon as i press run rather than when the fish is eaten?
Insufficient data to ascertain. You need to show the block of code that the block given above is enclosed within or, if the block given is the complete code for a method, the block of code that contains the call to this method.
You need to login to post a reply.