What is the best way to handle multiple similar sprites, that each need to be able to interact with all of the other individually? For instance, an ideal gas model where each molecule needs to bounce of any molecule it touches, or an star cluster simulation where each star responds to the gravity of all the others? I know how to do it manually, but I was hoping that there might be a way to use lists so that it would be less labor intensive to tweak it.
Thanks,
- Joe
Offline
One approach might be to use lists to maintain the state of the individual bodies...then use a single sprite to stamp the location of each body during the display loop. It would be pretty slow but might be acceptable in Turbo mode in Scratch or the Flash viewer.
Offline