Frame-based animation

Richard MacLemale richard at richardmac.com
Sat Feb 11 07:52:49 EST 2012


On Feb 11, 2012, at 7:38 AM, Ken Corey wrote:

> I'm a LiveCode newbie, but I'd want to minimise the time spent asking "is it time for me yet" for each of those commands.
> 
> I'd probably try to put the commands into a list ordered on the frame number.  Your insert is a little trickier here, because you need to preserve the order of the frame number.
> 
> Each time through the loop, you look at the first command on the list, and if the current frame is less you know no actions are due and ignore it, if it matches, remove it from the list and perform the action, and then check the next item on the list.
> 
> Does that make sense? Is there a better way to handle such things in LiveCode?

Yeah, I definitely want to write the tightest code I can, because animation is so time sensitive.  I'm thinking maybe I can use an array, where each frame is a key, maybe...

---
Richard MacLemale
Music = http://www.richardmac.com
Programming = http://www.macandchee.se



More information about the use-livecode mailing list