04-09-2025, 04:09 AM
Code: (Select All)
''animate a sprite array
''load the sprite
Dim frames&(1 to 3)
frames&(1) = _LoadImage("blue1.bmp")
frames&(2) = _LoadImage("blue2.bmp")
frames&(3) = _LoadImage("blue3.bmp")
Screen _NewImage(640, 480, 32)
_ClearColor _RGB(255,0,255)
Do
start_time# = Timer(.001)
cls
''---------do work here-------------
Animate(frames&())
''---------------------------------
''fps
Print (1 / (Timer(.001) - start_time#))
_Display ''flip automatic page buffer manually
_Limit(60)
Loop Until Inkey$ <> ""
Sub Animate(anim() as Long)
Static count&
Static frame&
count& = 0
frame& = 1
If count& > 10 Then frame& = frame& + 1
If frame& > LBound(anim) Then frame& = 1
''_ClearColor _RGB(255,0,255)
_PutImage (10, 10), anim(frame&)
End Sub
I have no idea why this won't compile. I don't get any error codes or anything. Maybe a linker issue? I running this on Linux Mint 64bit. Just testing some quick and dirty animation.
blue1.bmp (Size: 12.05 KB / Downloads: 212)
blue2.bmp (Size: 12.05 KB / Downloads: 201)
blue3.bmp (Size: 12.05 KB / Downloads: 195)

