how to make this rope stay swinging for left and right?
how to make this rope stay swinging for left and right?//change this... super(600, 400, 1); //or some other numbers //...to super(600, 400, 1, false);
private double speed;
public void act()
{
int r = getRotation();
if (r>90) speed -= 0.15;
else speed += 0.15;
setRotation((int)(r+speed));
}GreenfootImage base = getImage(); GreenfootImage image = new GreenfootImage(base.getWidth(), base.getHeight()*2); image.drawImage(base, 0, base.getHeight()); setImage(image);