; Load Bubble Media which is located two folders back from ; this path. BubbleImage=LoadNewImage("..\../Media/bubble_64x64.bmp") PrepareFXImage BUbbleImage ; Create a number of ranomdly positioned sprites For lp=1 To 25 ; Get a random coord on the screen X=Rnd(GetScreenWidth()) Y=Rnd(GetScreenHeight()) ; Create a sprite Spr=NewSprite(X,y,BubbleImage) ; Center this sprites handle CenterSpriteHandle Spr ; Set this sprites drawmode to plain rotated SpriteDrawMode Spr, 2 ; Set the Alpha Add colour to a random RGB colour SpriteAlphaSubColour Spr, RndRGB() Next ; limit the program to a max of 100 frames per second SetFPS 100 Do ; Clear the Screen Cls RGB(10,20,40) ; Get the Mouse Pointers Position mX=MouseX() mY=MouseY() ; Update the Sprites TurnSpeed#=1 Sprite=GetFirstSprite() While Sprite ; check if the mouse pointer is hitting this sprite If PointHitSpritePixels(mx,my,sprite,1)=false ; Turn This sprite TurnSprite Sprite,TurnSpeed# ; Set this sprites drawmode to rotated with ; Alpha COlour Addition SpriteDrawMode Sprite, 2 Else ; Set this sprites drawmode to rotated ; with Alpha Colour Subtraction SpriteDrawMode Sprite, 2+8192 EndIf ; Bump The Turn Speed TurnSpeed#=TurnSpeed#+0.25 ; Get the NExt Sprite Sprite=GetNextSprite(Sprite) EndWhile ; Draw All The Sprites DrawAllSprites ; Display information Print "Move The Mouse Stop Sprites Rotating" ; Show the screen Sync ; Loop back to the Do statement to keep program running Loop |