Hello
An experimental Demo
include "asm.inc"
window 640,480,1
! timeGetTime Lib "winmm.dll" () As Long
! timeBeginPeriod Lib "winmm.dll" (long uPeriod) As Long
! timeEndPeriod Lib "winmm.dll" (long uPeriod As Long
! Sleep Lib "kernel32" (long duration) As Long
LoadSprite "bmp/e5x.bmp",5
Sub Timed(sys Interval)
timeBeginPeriod (1)
StartTime = timeGetTime
NextFrameTime = Interval + StartTime
while timeGetTime() < NextFrameTime
if timeGetTime()+5 < NextFrameTime then
Sleep NextFrameTime - (timeGetTime()+5)
end if
wend
timeEndPeriod (1)
End Sub
int z[40], x[40], y[40]
for i=0 to <40
z[i] = rand(0,4)
x[i] = rand(0,512)
y[i] = rand(0,352)
next
while key(27)=0
cls 0,0,0
for i=0 to <40
Sprite 1,x[i],y[i],128,128,z[i]
next
for i=0 to <40
z[i] +=1
if z[i] = 5
z[i] = 0
x[i] = rand(0,512)
y[i] = rand(0,352)
end if
next
text 210,16,15,"FRAMES " & GetFps()
z +=1
if z=5 then z=0
redraw
'SetFps (24)
Timed (32)
wend
winEnd
.