PDA

View Full Version : How to move objects between lists


tmorgan1689
02-06-2007, 12:56 PM
Hello all, I am working on an Independent Study project in which I am simulating a population of penguins. I have one list of penguins walking around in random directions contained in a square. That part works fine.

Then I started making a birth method, where if two of the penguins in a list get within 1 meter of each other, a new penguin is setShowing as True. I have a list where these invisible penguins are in. This part also works fine.

Now my question is, after the invisible penguin is set to show, is there a way to move it over to the first list so it moves around as well. Basically as soon as it shows I want it to switch lists. Also, is there a way to add objects to a list as the world is running, like in the code? If this is possible I will be able to do what I need.

If anyone knows how to do this or has any suggestions they would be appreciated. Or if you have a different theory on a way to do what I want to I would like to hear it. Thanks for your time.

Also if you want me to put up the source file for you to understand more I can, or if something is unclear, just tell me and I'll try to explain it more.