Re: Frame-based animation

2012-02-12 Thread Bob Sneidar
Right. Code that is executed in a DO command is compiled each time and so will take much longer to execute. Bob On Feb 11, 2012, at 10:33 AM, Ken Corey wrote: > On 11/02/2012 17:53, Richard MacLemale wrote: >> Well, I know one thing - trying to put script steps in an array and run it >> on t

Re: Frame-based animation

2012-02-11 Thread John Craig
Hi, Richard. I tried a frame based demo animation with one main animation loop that locks the screen then updates all objects. I found that instead of trying to update certain objects at frame X, etc, updating everything on every frame worked best (for this particular demo anyway). Objects do

Re: Frame-based animation

2012-02-11 Thread Richard MacLemale
On Feb 11, 2012, at 1:33 PM, Ken Corey wrote: > > I don't know what the engine does to the code...the code might be "compiled" > (I use that term loosely) down, where evaluated code isn't. > > Hrm...can you abstract each little script enough to make little commands? > > on appearFlower > set

Re: Frame-based animation

2012-02-11 Thread Ken Corey
On 11/02/2012 17:53, Richard MacLemale wrote: Well, I know one thing - trying to put script steps in an array and run it on the iPad 1 is NOT a winning idea. It's taking 163 milliseconds to execute two lines of code that way. My window is more like 33 milliseconds. Back to the old drawing b

Re: Frame-based animation

2012-02-11 Thread Malte Brill
Hi Richard, here is a bareBone frame based handler... Very crude, nothing special. I assume for starters this is in a button. You will want to do adjustments. Cheers, Malte local sStartTime,sCurrentFrame on mouseUp set the flag of me to not the flag of me if the flag of me then

Re: Frame-based animation

2012-02-11 Thread Richard MacLemale
Well, I know one thing - trying to put script steps in an array and run it on the iPad 1 is NOT a winning idea. It's taking 163 milliseconds to execute two lines of code that way. My window is more like 33 milliseconds. Back to the old drawing board, as they say... --- Richard MacLemale Musi

Re: Frame-based animation

2012-02-11 Thread Richard MacLemale
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,

Re: Frame-based animation

2012-02-11 Thread Ken Corey
On 11/02/2012 12:19, Richard MacLemale wrote: I'm creating a variable called frameNumber and each time the loop is triggered I'm adding 1 to it. Since I've scripted my loop to run 30 times per second, after 1 second the frameNumber would be 30. OK, so I want certain lines of code to be run a