The main problem is that your world has a cell size greater than 1. The Mover class was created for a pixel-cell-sized world. Adjusting the constants to compensate for your cell size in the 'atWorldEdge' method in the Mover class (and maybe also the comparison operators) should do the trick.
/**
* Test if we are close to one of the edges of the world. Return true is we are.
*/
public boolean atWorldEdge()
{
if(getX() < 20|| getX() > getWorld().getWidth() - 20)
return true;
if(getY() < 20|| getY() > getWorld().getHeight() - 20)
return true;
else
return false;
}
}
if this is the atWorldMove method in my Mover class would i change the 20's to a larger #?
I think you are right because I have a few more at world methods for some alien ships and they are supposed to turn when they reach the world's edge but the just turn right away even if they are in the middle of the world they just turn
As a side note: the reason 20 was being used in the Mover class originally was to compensate for a portion of the size of the object that was approaching the edge (in pixel-cell-sized worlds, up to half the image could be hidden outside the edge of the screen before the center of the object reaches the edge of the world). This effect is being compensated for by the size of your grid-cells.
Well, that change did not stop what the GumLoader shoots from not reaching the edge of the world.
BradH wrote...
the projectile is going about 4x farther than it did before it leaves the gun but it disappears in the middle of the world
The problem here is that the projectile is not a LongShot projectile, but a Gum projectile which has a life-span shorter than what it takes to reach the edge of the world.