Animation freeze

Scott Rossi scott at tactilemedia.com
Thu Mar 13 00:46:03 EST 2003


On 3/12/03 8:36 PM, "curry" <curry at pair.com> wrote:

> Has anyone ever made an arcade style game in Rev, or anything else
> that used a lot of animations with "move without waiting" and "send
> in time"?
> 
> I can't post the scripts as-is, I'd have to try to make a simpler
> script to post it here, but what I've seen with two or three
> different projects is that Rev can unexpectedly freeze visually,
> until you press Command-period one or more times to interrupt it.

Since you say you can cancel out of your script operation, it sounds like
some move event and/or script in your stack is not completing and as such is
preventing the rest of your scripts from executing.


> I'm not using any "wait until" statements, just "move" and "send".
> 
> Has anyone experienced this type of freezing and does anyone know a
> good way to avoid it or workaround?

I once built a stack that moved about 40 animated GIFs up and down the
screen simultaneously.  Worked great on Macs and most PCs but brought some
Win98 machines to their knees with errors.  However, I never ran into any
kind of freezing problem.

When moving many individual objects, I've found it's effective to give the
objects their own "intelligence": give each object it's own script (based on
a master script) that allows it to determine where it is at all times and
how it should behave; don't try to control many objects from a central
script.

Another thing you can try is to replace your move commands with looping
positioning statements, for example:

 on moveMe
    set the left of me to the left of me + 2
    send "moveMe" to me in 50 milliseconds
 end moveMe

A side benefit I've noticed is that, in some cases, this type of script
creates smoother on-screen movement than using the move command (your
mileage may vary).

Regards,

Scott Rossi
Creative Director, Tactile Media




More information about the use-livecode mailing list