public class aligator extends Actor
{
/**
* Act - do whatever the aligator wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
if(Greenfoot.isKeyDown("A"))
{
move(4);
}
if(Greenfoot.isKeyDown("B"))
{
move(-4);
}
if(Greenfoot.isKeyDown("c"))
{
turn(4);
}
if(Greenfoot.isKeyDown("D"))
{
turn(-4);
}
{
if(canSee(hamburger.class))
{
eat(Hamburger.class);
}
}
