![]() Preserved Topic: Faster then settimeout('move',1); (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: oslo, Norway |
![]() Is it posible to get "settimeout('move',1)" to go faster then this |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
![]() Technically, that code should move it so fast that in one second, it would go across the entire screen of a 1024x768 maximized window. |
Paranoid (IV) Inmate From: oslo, Norway |
![]() This is the intair function. |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
![]() Yar moving stuff 1 pixel at a time is a CPU hog. |
Paranoid (IV) Inmate From: oslo, Norway |
![]() Hmmmm, nice intervals, what is that?? |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
![]() Ummm not really anything in particular. |
Paranoid (IV) Inmate From: oslo, Norway |
![]() ok, no that not a problem just set the "=" to ">" |
Nervous Wreck (II) Inmate From: Pa, US |
![]() dont know if this is relevant, but if I know where my object is gonna start and finish, I like to make the computer decide the step size for me. All I have to know is how many steps (speed) I want it to make to get from start to finish, and it also gets rid of that pesky endpos-overshooting thing. |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
![]() The problem is, if you want it to go exactly, say, 61 pixels in five steps, there's no whole number step that can do that! What you can do, though, is keep track of the object's exact position in a separate variable. |
Paranoid (IV) Inmate From: oslo, Norway |
![]() Thanks, everyone |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
![]() Ah, yes, forgot your question, Osaires. You would use a for loop: |