I'm relatively new to greenfoot and have been asked to do a falling leaves project for one of my classes. This is the code:
The errors are occuring with the actor not being able to move
public class Basket extends Actor
{
int once = 1;
public void act()
{
if(once == 1 );
{
setLocation(1000,1000);
int once = 0;
}
int dx = 0;
if (Greenfoot.isKeyDown("right")) dx+=2;
if (Greenfoot.isKeyDown("left")) dx-=2;
if (dx!=0) setLocation(getX()+dx, getY());
if (getX()<5 || getX()>getWorld().getWidth()-6) setLocation(getX()-dx, getY());
}
}
