Coolamebe said:
Also is this how the comets orbit's are so elliptical and have points very close to the sun and very far away from the sun? Do they gravitationally slingshot themselves?
They don't get gravitationally slingshotted. First, think about what happens here on Earth if you throw an object. If it weren't for air resistance the object would continue at the same horizontal velocity but its vertical velocity would change under the influence of gravity, causing it to accelerate downwards until it hits the ground.
Now, what if we throw our object fast enough so that as gravity accelerates it down, it moves so fast that the curvature of the Earth causes the Earth to 'fall away' from the object as it travels. The object would continually 'fall' towards the Earth, but it would never be able to hit it because the surface of the Earth falls away from it. What we have here is a perfectly circular orbit.
Now, if we throw the object just a little faster, this orbit turns into an elliptical orbit, where the object recedes from Earth during part of the orbit and approaches the Earth during the other part. It still can't hit the surface because it has no way to get rid of its speed and thus fall to the ground.
If we throw our object
really hard, it will be flying too fast for gravity to ever bring it back to the Earth. Gravity still acts on it, but it can't slow it down enough.
The same thing happens with comets. They almost always fall in a manner that causes them to swing around the Sun instead of crash into it and they are rarely able to gain enough speed during their orbits to reach escape velocity.
Coolamebe said:
And does this happen with rogue planets, so if a rogue planet came close enough to be affected by the sun's gravity, would it just be attracted and become a part of the solar system or would it be slingshotted away?
It would almost always pass by and continue on without being captured. In order to be captured it would have to have some sort of gravitational interaction with the other objects in the solar system to slow it down.