Yea sorry, I forgot that part.
public void setLocation(int x, int y)
{
int width = getWorld().getWidth();
int height = getWorld().getHeight();
while (x >= width)
{
x -= width;
}
while (x < 0)
{
x += width;
}
while (y >= height)
{
y -= height;
}
while (y < 0)
{
y += height;
}
super.setLocation(x, y);
}
But I found my problem already. I just forgot to paste that code into the actual code.
Thanks so much for your help!