Code: Select all
InitSprite()
Structure mydot
x.f
y.f
u.f
v.f
life.f
s.f
EndStructure
Global NewList dot.mydot()
OpenWindow(1,0,0,640,480,#PB_Window_ScreenCentered|#PB_Window_SystemMenu,"Get Berikco!")
OpenWindowedScreen(WindowID(1),0,0,640,480,0,0,0)
Procedure BlowemUp(spotx,spoty)
For g=0 To 500
AddElement(dot())
angle.f=Random(359)*3.141592/180
dot()\life=1+Random(254)
dot()\u=Cos(angle)*Random(128)/64
dot()\v=Sin(angle)*Random(128)/64
dot()\v=dot()\v-1 ;this will make it go up
dot()\x=spotx
dot()\y=spoty
dot()\s=Random(15)/10
Next g
EndProcedure
myx=0:myy=200:myx2=620
Repeat
ev=WindowEvent()
ClearScreen(0)
StartDrawing(ScreenOutput())
If CountList(dot())<100
DrawText(myx-25,myy-38,"Brussels",#Red,#Black)
Circle(myx,myy,20,RGB(0,0,255))
If myx>200
Circle(myx2,myy,5,RGB(255,0,0))
EndIf
Else
myx=0:myy=200:myx2=619
EndIf
ForEach dot()
dot()\x=dot()\x+dot()\u
dot()\y=dot()\y+dot()\v
dot()\v=dot()\v+0.05
If dot()\x=>0 And dot()\x<=639 And dot()\y=>0 And dot()\y<=478
c=dot()\life
c=c+c<<8+c<<16
Circle(dot()\x,dot()\y,dot()\s,c)
EndIf
dot()\life=dot()\life-1:If dot()\life<=0:DeleteElement(dot()):EndIf
Next
StopDrawing()
FlipBuffers()
Delay(1)
myx+1
If myx>200
myx2-12
EndIf
If myx >619
myx=0
EndIf
If myx >= myx2-20
BlowemUp(myx+10,myy+10)
EndIf
Until ev=#PB_Event_CloseWindow
End




