Elvin,

>Is there a way move an object pixel per pixel throughout time?
>Say, I want to move an object/image 50 pixels. over .. say 6 seconds?


Easiest way is to divide the distance by the time to find the 
distance to move the sprite each exitFrame. Keep the next location 
for the sprite in a variable. (The sprite will only "move" a fraction 
of a pixel each time.)

Use the frameTempo to compensate for different frame rate settings.

Here's a behavior to play with:

----------------------------------------

property distSlice
property nextLocH
property destLocH


on beginSprite me

   theDistance = 50
   theTime = 6.0 -- Must be a float!

   timeSlice = theTime * the frameTempo -- Nr of times to move
   distSlice = theDistance/ timeSlice -- Amount to move each time

   nextLocH = sprite(me.spriteNum).locH -- Start pos of sprite
   destLocH = sprite(me.spriteNum).locH + theDistance -- End pos
end


on exitFrame me

   if destLocH <> sprite(me.spriteNum).locH then -- Check if done
     nextLocH = nextLocH + distSlice -- Compute next location
     sprite(me.spriteNum).locH = nextLocH.integer -- Move sprite
   end if

end

----------------------------------------


-A.



>
>Whilst I'm here.. I might as well ask. Umm
>
>I want to be able to change the characters in a given textfeild randomly?
>Like a scrabbled word?
>
>Thanks..
>
>Elvin M. Certeza, Jr.
>http://www.alphalink.com.au/~certeza/
>
>
>
>[To remove yourself from this list, or to change to digest mode, go 
>to http://www.penworks.com/lingo-l.cgi  To post messages to the 
>list, email [EMAIL PROTECTED]  (Problems, email 
>[EMAIL PROTECTED]). Lingo-L is for learning and helping with 
>programming Lingo.  Thanks!]

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to