Preserved Topic: Faster then settimeout('move',1); |
|
---|---|
Author | Thread |
Paranoid (IV) Inmate From: oslo, Norway |
posted 08-12-2001 17:56
Is it posible to get "settimeout('move',1)" to go faster then this |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 08-12-2001 21:26
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 |
posted 08-12-2001 22:24
This is the intair function. |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 08-12-2001 22:55
Yar moving stuff 1 pixel at a time is a CPU hog. |
Paranoid (IV) Inmate From: oslo, Norway |
posted 08-12-2001 22:59
Hmmmm, nice intervals, what is that?? |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 08-12-2001 23:07
Ummm not really anything in particular. |
Paranoid (IV) Inmate From: oslo, Norway |
posted 08-12-2001 23:11
ok, no that not a problem just set the "=" to ">" |
Nervous Wreck (II) Inmate From: Pa, US |
posted 08-13-2001 08:30
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 |
posted 08-13-2001 14:31
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 |
posted 08-13-2001 14:38
Thanks, everyone |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 08-13-2001 18:50
Ah, yes, forgot your question, Osaires. You would use a for loop: |