Scroll really slow
Blitz3D Forums/Blitz3D Beginners Area/Scroll really slow
| ||
How I would like any advise or comments on this...I am trying make an image scroll really slow. Here is my code: scroll% = scroll% + 1 (this is very smooth but too fast) scroll% = scroll% + 0.5 (this is not smooth but very slow) anyone have any ideas on how to make an image move smooth and slow at the same time?? |
| ||
you could use millisecs() to move the image. just check millisecs time elapsed each movment update. |
| ||
or, maybe use a float variable instead:scroll# = scroll# + 0.5 |
| ||
How would I use the millisecs() idea?? I have already tried: scroll# = scroll# + 0.5 it is still not smooth |
| ||
something like this should do. [CODE] Graphics 640,480,16,2 SetBuffer BackBuffer() Global next_check While Not KeyDown(1) ; If do_delay_check(2) = 1 Then Print "Reset Timmer" EndIf Wend Function do_delay_check(secs) secs = secs * 1000 If Not MilliSecs() < next_check + secs next_check=MilliSecs() secs = 0 Return 1 Else Return 0 EndIf End Function [/CODE] kev |
| ||
hmmm...I will try this |
| ||
Luke - an image can only be placed to the nearest pixel, even if you use floats, hence the herkiness? If you have blitz3D you could try using a sprite with the image on and moving it with a float. |
| ||
Would you happen to have an example of how to animate with a sprite...I thought sprites and images were the same |
| ||
No, an image is just that, an image dtawn onto the screen pixel for pixel. A sprite is a scalable, rotatable, etc. 3D object with an image on it. |
| ||
ok I see...is there any examples in the blitz manuals on how to use sprites?? |