ID:269249
 
im trying to make a black hole kinda of code

some thing like this:



Free Image Hosting at www.ImageShack.us


the small lines are the distance


so if your farther away from the hole the less it will pull you to it but the close you get the harder it pulls when you get to the center BOOM you die



any help would be great



Dave^^
The nice thing about black holes is that they work the same as any other gravitational body. The force of attraction between two bodies of mass is

F = GMm/r^2

G is your gravitation constant. If you are converting your units into real world usint you can just look up the real universal gravitation constant otherwise you just have to play around with the number until it feels right.

M is the mass of the first body. m is the mass of the second. r is the distance between the centers' of mass of the objects.

A black hole is nothing more than an extremely dense chunk of mass. Which means you can get very close to the center of mass relative to the total mass. This causes the escape velocity to be very high(greater than the speed of light).