0

I am trying to calculate X and Y speed for small object that are attracted by gravity of one big object This is video how my calculation works. As you can see after a while every small object goes into one point. I want achieve moves like in this video. How may I calculate X and Y speed. I have saved coordinates of all small object in list and every game cycle I add X speed to X coordinate and Y speed to Y coordinate.

kubaj
  • 63
  • 1
  • 7
  • What language are you programming in? You need to have a go yourself, no-one here is going to program the whole thing for you. If you're writing for the web, I suggest you have a go using JSFiddle.net and post a question when you run into a problem. As it stands, no-one knows what you're capable of doing and so would have to write the whole thing for you. – Jodes Mar 08 '13 at 16:31
  • I am writing in C# with XNA framework, I don't want whole code but only principle how to make it – kubaj Mar 08 '13 at 19:12

1 Answers1

0

From what I can tell from the videos, in yours, the speed is variable. And in the video that you're aiming for, the velocities are either -1 or 1? It seems in both cases, (more so with your version admittedly) the small objects converge to a point.

Jodes
  • 14,118
  • 26
  • 97
  • 156