; Get the SCreen Width+ Height Sw=GetScreenWidth() Sh=GetScreenHeight() ; Create 100 circles MaxCircles=100 Type tCircles X#,y#,speedx#,Radius,COlour EndType Dim Circles(MAxCircles) As tcircles For lp=0 To MaxCircles Circles(lp).x# =Rnd(sw) Circles(lp).Y# =Rnd(sh) Circles(lp).speedx# =-RndRange(2,10) Circles(lp).Radius =RndRange(5,30) Circles(lp).Colour =RGBFade(RndRGB(),50) Next ; Create an FX image the Size of the ScreenImage=GetFreeImage() CreateFXImage ScreenImage,sw,sh ; start of do/loop Do ; Tell Pb to Draw to this image RenderToImage ScreenImage ; Do a Alpha Subtract from the the Screen Image InkMode 1+128 ; Draw Alpha SUb Box over the entire image to fade it out BoxC 0,0,sw,sh,true,RGB(16,16,16) ; Set the Ink Alpha Mode to Alpha ADD InkMode 1+64 ; Loop through and update the circles For lp=0 To MaxCircles ; Calc this cirecly next position X#=Circles(lp).x#+Circles(lp).Speedx# If x#<0 Then X#=x#+sw CircleC x#,Circles(lp).y#+SinRadius(Angle#,20),Circles(lp).Radius,true,Circles(lp).Colour Circles(lp).x#=x# Next ; Set the Ink mode to Filled Alpha 50/50 InkMode 1+32 CircleC sw/2,sh/2,150,true,_ RGB(20,50,CosNewValue(100,angle#,100)) angle#=WrapAngle(angle#,1) ; Restore the Ink ALpha mode to normal InkMode 1 ; Tell PB to render to the screen now RenderToScreen ; draw our screen sized second image to the screen DrawImage ScreenImage,0,0,false ; Display the Graphics engines current MMX state If getgfxmmx() m$="MMX Is Enabled In the GFX engine" Else m$="MMX Is Disabled In the GFX engine" EndIf Text 0,0,m$ ; Check if space key has eben pressed, If so Toggle ; the GFX engines MMX state If SpaceKey() gfxmmx 1-getgfxmmx() FlushKeys EndIf ; Display the Screen Sync ; Loop back to the do statement Loop |