Where do you call it from? (show me)
public void fire()
{
Bullet b = new Bullet();
getWorld().addObject(b,getX(),getY());
shell s= new shell();
getWorld().addObject(s,getX(),getY());
s.fall();
b.setRotation(getRotation());
b.move(20);
}public void fall()
{
int r=Greenfoot.getRandomNumber(60);
setRotation(60+r);
}// instance variables
double realX, realY;
// method addedToWorld(World world)
public void addedToWorld(World world)
{
realX = (double) getX();
realY = (double) getY();
}
// method move()
public void move()
{
realX += Math.cos(getRotation() * Math.PI / 180);
realY += Math.sin(getRotation() * Math.PI / 180);
setLocation((int) Math.round(realX), (int) Math.round(realY));
}