says ')' expected import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Lobster here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Lobster extends Actor
{
/**
* Act - do whatever the Lobster wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
moveAround();
eat();
}
public void moveAround()
{
move(4);
if (Greenfoot.getRandomNumber(100) < 10)
{
turn (Greenfoot.getRandomNumber(90) - 45);
}
if (getX() <= 5 1 1 getX() >= getWorld().getWidth() - 5)
{
turn(180);
}
if (getY() <= 5 1 1 getY() >= getWorld().getWidth() - 5)
{
turn(180);
}
}
public void eat()
{
Actor crab;
crab = getOneObjectAtOffset(0, 0, Crab.class);
if (crab != null)
{
World world;
world = getWorld();
world.removeObject(crab);
Greenfoot.playSound("eating.wav");
} } } and yes i know it looks weird with the brackets at the end like that but it says its ok so the problem is right after the 5 in if (getX() <= 5 1 1 getX() >= getWorld().getWidth() - 5)