I replace static type with ordinary INT inside fn LoadTiles():
Function LoadTiles(string File, sys xFrame,yFrame) as sys
iF xFrame=0 Then xFrame=1
iF yFrame=0 Then yFrame=1
int id: iF id <512 Then id +=1
THnd(id) = call LoadImage 0,File,0,0,0,16
THdc(id) = call CreateCompatibleDC(hdc)
call SelectObject THdc(id), THnd(id)
call GetObject THnd(id), sizeof info, &info
TWidth (id) = info.bmWidth /xFrame
THeight(id) = info.bmHeight/yFrame
Return id
End Function
and also i replace single with float type just to test how work.
float jv,zv,dv,r,za
And game work fine with good speed..