This is what I have in the Shell class:
import greenfoot.*; public class shell extends Animal { double realX, realY; public void addedToWorld(World world) { realX = (double) getX(); realY = (double) getY(); } public void act() { move(); } public void fall() { int r=Greenfoot.getRandomNumber(60); setRotation(60+r); } 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)); } }