ive been working on the crab totorial and i some how messed up because i dont have as many yellow boxes asw the picture does but at the end its saying World world; isnt a statement any help?
if (Greenfoot.isKeyDown("left")) { turn(-3); } if (Greenfoot.isKeyDown("right")) { turn(3); } Actor worm; worm = getOneObjectAtOffset (0, 0, Worm.class); // { *** removed this one if (worm != null) { // *** added this one World world; world = getWorld(); world.Remove0bject(worm); }
public void act() { moveAndTurn(); eat(); Move (4); } public void move() { if (Greenfoot.isKeyDown("left")){ turn(-3); } if (Greenfoot.isKeyDown("right")){ turn(3); } } public void eat() { Actor worm; worm = getOneObjectAtOffset (0, 0, Worm.class); if (worm != null) { World world; world = getWorld(); world.Remove0bject(worm); } } }