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

Report as inappropriate.

joel
joel presents ...

2013/8/12

little-crab

this is my frist game and i dont know the command to finish to player game. i need help

3526 views / 8 in the last 7 days

1 vote | 0 in the last 7 days

Tags: with-source

open in greenfoot
Your browser does not support the canvas tag.
joeljoel

2013/8/16

use right and left arrow keys to move the upper crab and use ''A'' and ''D'' keys to move the second crab.
joeljoel

2013/8/16

hi every one how can i make the game stop when the both crabs are eaten? need help thank you
KartoffelbrotKartoffelbrot

2013/9/15

To stop the game you should use Greenfoot.stop(). It's like pressing the run button again. To Count how many crabs are in the game you can use the getObjects method of the world. You can add this method to the world: public void stopWhenCrabsAreEaten(){ if(getObjects(Crab.class).size()==0) Greenfoot.stop(); } Then you have only to add the act method into the world, if you hadn't done this already. public void act(){ stopWhenCrabsAreEaten(); } I hope I was able to help you :)

Want to leave a comment? You must first log in.

Who likes this?

sametguzelgun