At 6:26 PM +0200 3/17/05, Michael Nadel wrote:
You can animate in ways that would be the same speed on all machines, but would skip frames on slower machines.
i guess that would be the way to go; animation should (i think) always be time-based, and not frame-based.
if you create animation this way, it also runs much smoother on fast machines,
at least visually, because whenever a machine stalls for a split second,
the next frame will be rendered as if the stall never happened..
the way to do it, is to instead of creating score-/frame-based animation,
animate objects using (parent) scripts.
such a script would check the time that has passed since the last frame/render,
and based on that time difference move an object an x-number of pixels across the screen,
or have it grow/shrink a certain percentage.
if you calculate these positions as floating-point numbers, and keep them stored
in a property of that script, the animation will become even smoother,
since also the actual positions are based on the time passed,
and not on the last position in the pixel-world.
(i mean, an object can very well just move 1/10th pixels per second...)
and regardless the machine it's running on, an animation will always take the same amount of time.
another advantage is, that when you use this approach in all lingo-scripting,
you can very easily distribute computing-time between various processes in your app,
and actually mimick a kind of pseudo 'threading'.
it gives you complete control over what happens when, and how long it takes..
this also means that you can make your director projector run smoother/faster on slow computers,
because if you use score-/frame-based director, it will always try to render each and every frame,
which indeed will take longer on slow machines than on fast machines.
to be honest, i never use the score at all
(apart from one behaviour on frame, to tell director to stay in frame one...)
arri
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [email protected] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
