Yeah, the Physics behavior.
That's an smart solution I've tried... but it doesn't work (more accurately: I can't make it work in my project... but yes, it would be great). I get crazy because of this... <img src="smileys/smiley5.gif" border="0" align="middle">
Maybe if I describe what I want to do and what I need, someone would be able to help me. Here is the gameplay loop (unfortunaly it is an old version but you'll be able to figure out what it is about and in which context I need to have a physical objet "animated").
http://dl.dropbox.com/u/63083711/index.html
- The physical objets I mentioned are randomly generated from the bottom of the screen, every X frames.
- First, I create the physical objet. I give it an ID (taken from a enemy count... I could use the IID but it doesn't work either, I suppose the problem doesn't come from there).
- Then I spawn on it the visual aspect. I give it an ID, the same than the physical objet, in order to link both.
- I can't link the two objets :o It's a mess: the very first spawned object and its visual aspect move as they should do, and once the second physical objet is spawned, all the visual aspects just... stop and don't follow the physical objects.
Here is the code I use:
<img src="http://dl.dropbox.com/u/63083711/screenshots/enemies01a.png" border="0">
<img src="http://dl.dropbox.com/u/63083711/screenshots/enemies01b.png" border="0">
<img src="http://dl.dropbox.com/u/63083711/screenshots/enemies02.png" border="0">
That's the way I've done with the dropped balls (it's a physical objet with a visual aspect over it), but I don't know why... in this case, it worked :o
Seriously, that's something that made me crazy for hours, maybe I've missed something obvious and stupid... but now, I don't know how to identity an objet among other similar, after having spawned them "generically". If I could master that kind of things, everything would be easier...
Thanks in advance.
Rag'
PS: I may be unclear in my explanations and expectations... If so, please don't hesitate to ask questions in order to identify what's wrong. I really need to make it work <img src="smileys/smiley19.gif" border="0" align="middle">