this might help (see CheckAlpha() ):
// set display properties
SetVirtualResolution( 1280,720 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
GLOBAL Alpha100, MySprites as Integer []
MakeSprites()
ShuffleSprites()
CheckAlpha()
do
If GetRawKeyPressed(27) then End
If GetPointerPressed()
ShuffleSprites()
CheckAlpha()
EndIf
Print("Click to Shuffle")
Print( Alpha100 )
Sync()
loop
Function CheckAlpha()
Alpha100 = 0
For x = 0 to MySprites.Length
ThisAlpha = GetSpriteColorAlpha( MySprites[x] )
If ThisAlpha = 100
SetSpriteColor(MySprites[x], 255,0,0,ThisAlpha)
INC Alpha100
Else
SetSpriteColor(MySprites[x], 255,255,255,ThisAlpha)
EndIf
Next x
EndFunction
Function MakeSprites()
for x = 1 to 50
MySprites.Insert(CreateSprite(0))
next x
EndFunction
Function ShuffleSprites()
For x = 0 to MySprites.Length
ThisSPR = MySprites[x]
SetSpritePositionByOffset(ThisSPR, Random(100,1160), Random(100,620))
SetSpriteColorAlpha(ThisSPR, 50 + Random(1,4)*50)
Next x
EndFunction