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.


Post Reply  Post Thread 
animations in murgalua
Author Message
iGame3D
Moderator
***


Posts: 231
Group: Moderators
Joined: Apr 2007
Status: Offline
Reputation: 0
Post: #1
RE: animations in murgalua

At the bottom of lib/bezier.lua

Code:
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

--- LoopBackAndForth
    while cnt < 101 do  
      pos = points[cnt]
      sprite:position(pos.x,pos.y)
            Fl:check();
           window:redraw();

--- rebound looping
if cnt==100 then mSpeed =-1
  elseif cnt==1 then mSpeed =1
  end

--- move the counter
cnt=cnt+mSpeed
    end
end

This post was last modified: 06-05-2007 02:10 PM by iGame3D.

05-30-2007 12:08 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
animations in murgalua - widged - 05-28-2007, 09:16 AM
RE: animations in murgalua - widged - 05-28-2007, 10:28 AM
RE: animations in murgalua - widged - 05-28-2007, 10:36 AM
RE: animations in murgalua - iGame3D - 05-28-2007, 12:31 PM
RE: animations in murgalua - chrimo - 05-29-2007, 08:10 AM
RE: animations in murgalua - mikshaw - 05-29-2007, 09:52 PM
RE: animations in murgalua - iGame3D - 05-30-2007 12:08 AM
RE: animations in murgalua - mikshaw - 06-23-2007, 05:57 PM
RE: animations in murgalua - iGame3D - 06-25-2007, 10:36 AM
RE: animations in murgalua - mikshaw - 06-25-2007, 11:31 AM
RE: animations in murgalua - JohnMurga - 06-27-2007, 10:01 AM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: