To make long story short, my code lags with lots of objects and I'm looking a way to speed it up. Pleas Help as it is for my Uni project MMF2/F2.5!
- Source = Planet
- Object/Children = Satellite
- Each Planet can have random number of Children (0-16)
With 100 planets there can be betwen 0-1600 satellites and each follows their independent Planet on specified distance (planets can change size real time, and level also scales).
1) Attempt to count only Satellites/Planets for visible (in range) but how to limit loop to only that amount, and know specifically that I refer to them?
2) Instead of loops use array (proposed by snail) but I never used them in such scale and... I even don't know where to start
3) Any other idea which could speed it up would be wonderful.