Scroll really slow

Blitz3D Forums/Blitz3D Beginners Area/Scroll really slow

luke101(Posted 2004) [#1]
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??


Kev(Posted 2004) [#2]
you could use millisecs() to move the image. just check millisecs time elapsed each movment update.


Jeppe Nielsen(Posted 2004) [#3]
or, maybe use a float variable instead:
scroll# = scroll# + 0.5



luke101(Posted 2004) [#4]
How would I use the millisecs() idea??

I have already tried:
scroll# = scroll# + 0.5
it is still not smooth


Kev(Posted 2004) [#5]
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


luke101(Posted 2004) [#6]
hmmm...I will try this


Who was John Galt?(Posted 2004) [#7]
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.


luke101(Posted 2004) [#8]
Would you happen to have an example of how to animate with a sprite...I thought sprites and images were the same


WolRon(Posted 2004) [#9]
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.


luke101(Posted 2004) [#10]
ok I see...is there any examples in the blitz manuals on how to use sprites??