public void atEdgeOfWorld()
{
if(getX() == (getWorld().getWidth()-1))
{
setLocation(0, getY());
}
else if(getX() == 0)
{
setLocation(getWorld().getWidth(), getY());
}
if(getY() == (getWorld().getHeight()-1))
{
setLocation(getX(), 0);
}
else if(getY() == 0)
{
setLocation(getX(), getWorld().getHeight());
}
}