This content has been marked as final. Show 3 replies
Instead of using exitFrame, try prepareFrame or startFrame (or whichever
combination works best)
Actually, enterFrame is the place to put frame code as it's given the
largest time slice. Also, make sure your frame rate is high enough -
30fps is a good start.
Grrr. I wrote a nicely detailed reply to this that seems to have been chewed up.
In short. my own experience is that sprite organization (channel numbering) and messageordering is more important than which handler (prepareframe/exitframe) you use. If the leading sprite gets its position update after the following sprites have already checked to see if they should move, it really doesn't matter if you do it at the end of a frame or the beginning of a frame.
I'm providing a simple pair of behaviors for a 3-sprite system that lets you click on any of the sprites to move the group. They're pretty much in lockstep with each other, And they do it on exitframe. The following behavior goes on two of the sprites; the leader behavior goes on the lowest-numbered sprite. Expand for more sprites and more flexibility.