Something wrong with Static
Posted: Thu Mar 24, 2016 7:17 pm
This code work fine with 1.20 and dont work with 1.30 , This is probably due to static, but I do not know how to highlight (comment le mettre en évidence)
Code: Select all
;*****************************************************************************
;*
;* Name : Dots
;* Author : Petr Vavrin (peterb)
;* Date : 15.06.09
;* Notes :
;*
;* Adaptation SpiderBasic Comtois , le 28/02/16
;*****************************************************************************
Macro SinCos(a,b)
(Sin(a)+Cos(b))
EndMacro
#p=#PI/180
#n=0.001
Global Dim x(99)
Global Dim y(99)
Global Dim v.f(99)
Global Dim w(99)
Global Size=400
InitSprite()
OpenWindow(0,0,0,Size,Size,"",$C80001)
OpenWindowedScreen(WindowID(0),0,0,Size,Size,1,0,0)
CreateSprite(0,Size,Size)
CreateSprite(1,32,32,#PB_Sprite_AlphaBlending)
StartDrawing(SpriteOutput(1))
Circle(16,16,16, RGB(255,0,0))
StopDrawing()
Procedure RenderFrame()
Static.f a,b,c,e,f,g,i
Static h=99,k=99, s.f=20
If h=k
e=Random(k)
f=Random(k)
g=Random(k)
i=s-Random(50)
h=0
EndIf
h+1
a.f+#n*e
b.f+#n*f
c.f+#n*g
s-i/k
x(0)=SinCos(a,b)*30+Size/2
y(0)=SinCos(b,a)*30+Size/2
v(0)=c
w(0)=s
l=30
nb=1
While l
n=l-1
x(l)=x(n)
y(l)=y(n)
v(l)=v(n)
w(l)=w(n)
m=0
While m<360
t.f=m*#p+v(l)
u.f=#p-v
DisplayTransparentSprite(1,x(l)+SinCos(t,u)*w(l),y(l)+SinCos(u,t)*w(l),255-(l*8))
Nb + 1
m+60
Wend
l-1
Wend
FlipBuffers() ; continue the rendering
EndProcedure
FlipBuffers() ; start the rendering
BindEvent(#PB_Event_RenderFrame, @RenderFrame())