@Override
	public Vector2D calculateGravity(double elapsedTime) {
		LinkedList<Sprite>sprites = parent.getParent().parent.getMap().getSprites();
		Vector2D force = new Vector2D(0,0);
		for(int i = 0; i < sprites.size(); i++){ // Add all sprites that are planets
			if(sprites.get(i) instanceof Planet){
				Planet p = (Planet)sprites.get(i);
				double g = .08;
				double pMass = p.dMass;
				double sMass = parent.getMass();
				Vector2D pCenter = p.getPosition().plus(new Vector2D(p.getWidth()/2, p.getHeight()/2));
				Vector2D sCenter = parent.getPosition().plus(new Vector2D(parent.getWidth()/2, parent.getHeight()/2));
				double distanceSQ = sCenter.distanceSq(pCenter); //the new vector offsets the position so we orbit around the center of the planet
				double distance = sCenter.distance(pCenter);
				double pRadius = p.circle.getBounds().height/2;
				
				//this part allow the ship to settle into the planet and stop
				if(distance > 35 && distance < pRadius-150){ // don't calculate if too close, or too far
					Vector2D preForce = new Vector2D(0,0);
					preForce = (pCenter.minus(sCenter));
					preForce = preForce.scalarMult(g * pMass * sMass);
					preForce = preForce.scalarDiv(distanceSQ);
					force = force.plus(preForce);
				}else if(distance <= 9){
					parent.setVelocity(parent.getVelocity().scalarMult(-.5));
				}
			}
		}
		force = force.scalarMult(elapsedTime/1000);
		return force;
	}