News : The level of daily SPAM has reached insane proportions, all registrations are now manual.
I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.

Having a go at this. Read the Lua 5.0 manual.. nice language! Problem is this is my first lua program. What I tried to do was rewrite a nice little script to move a sprite along a bezier line I wrote with another language.

As I don't know how to make a drag and drop, I use dials to specify the position of the two orange points that makes the extremities of a bezier curve and two green points to define the position of the control handles. This part works nicely.

What I can't figure out how to manage is the animation business. I defined the part of the script that will move the sprite as a coroutine and I resume that coroutine when the user press on the play button. This works when I force an onscreen event to occur (having a message box display a message). This doesn't work anymore when I remove it.

New version of the script:animation script
(run anim.lua from within the folder that contains that file)

And for the fun of it, the script in action, captured in a screencast
(quicktime movie recorded on a mac, may not show properly on a pc or linux machine -- the animation is a *lot* smoother than on this movie)

This is a groovy test. I'm wondering if I'm seeing it the way it's supposed to be, though. Rather than gradually moving across the window as I expected, the car appears to leap very quickly between a pair of points. It seems to be animated in the sense that I can see the car very briefly at a middle point, but the movement is so quick I'm not sure if it isn't just an optical illusion or if the car is being redrawn as quickly as possible (no wait) at each point along the curve.

function run_anim(srpite,points)
local pos = {}
for p = 1,100 do -- should loop for the number of entries in points
pos = points[p]

Fl:wait(.004);
sprite:position(pos.x,pos.y)
window:redraw();
end

end

Should be some kind of speed adjuster around Fl:wait(.004);

On my iMac this is very smooth and Marielle has the same iMac specs mostly.

I replaced with Fl:check();
and it remained smooth so Fl;wait isn't even necessary in there

This works smooth here.

Code:

function run_anim(srpite,points)
local pos = {}
for p = 1,100 do -- should loop for the number of entries in points, set to 10 for testing purposes
pos = points[p]
sprite:position(pos.x,pos.y)
Fl:check();
window:redraw();
end
end

THIS LOOPS BACK AND FORTH

Code:

function run_anim(sprite,points)
local pos = {}
local cnt=1
local loopMod=1

Attached is an animated image sequence demo.
It uses a repeat button as a cheat for an actual loop, which I guess should not be needed with murgaLua 0.5
From John's recent drawing tests it seems like it could be done in 0.4.1, but I don't quite understand how =o)

That's pretty cool. I definitely have to look into that autoplay.
Unfortunately it will need some tweaks to work on my system.
The animation doesn't "animate", in that there is usually a set number of frames per second in an animation but this one tore through the frames so violently that it skipped most of them, my cpu went crazy, and my desktop froze =o)