Author Topic: Screen Save Circles (using random command )  (Read 25 times)

Alex

  • Newbie
  • *
  • Posts: 3
    • View Profile
Screen Save Circles (using random command )
« on: May 18, 2020, 01:33:03 PM »
Var AJ Integer, LJ Integer, X1 Integer, Y1 Integer, Tam Integer
Var IncX1 Integer, IncY1 Integer
Var RGB1 Integer, RGB2 Integer, RGB3 Integer, Inc1 Integer, Inc2 Integer, Inc3 Integer
Var TC String, LM Integer
'Creating a black window a nd remove mouse cursor
Window Background = Black, Res = 255, 255, Size = Max, Max,Border = False, Cursor = False
'Get the window dimention
AJ = WindowHeight()
LJ = WindowWidth()
'set the vars
X1 = Random(AJ)
Y1 = Random(LJ)
IncX1 = Random(5)+1
IncY1 = Random(5)+1
RGB1 = Random(255)
RGB2 = Random(255)
RGB3 = Random(255)
Inc1 = Random(10)+1
Inc2 = Random(10)+1
Inc3 = Random(10)+1
Tam = 30
'get a one position mouse
Wait 100
LM = MouseY
'if no move the mouse or prees a key it wil keep a loop
While TC = "" And MouseY = LM
 TC = KeyTest("?")
 Circle X1,Y1,Tam,RGB(RGB1,RGB2,RGB3)
 X1 += IncX1
 Y1 += IncY1
 If X1 < 0
  X1=0
  IncX1 = Random(5)+1
  Tam = Random(30)
 EndIf
 If X1 > AJ
  X1=AJ
  IncX1 = IncX1 * -1
  Tam = Random(30)
 EndIf
 If Y1 < 0
  Y1=0
  IncY1 = Random(5)+1
  Tam = Random(30)
 EndIf
 If Y1 > LJ
  Y1=LJ
  IncY1 =  IncY1 * -1
  Tam = Random(30)
 EndIf
 If Tam < 10
   Tam = 10
 EndIf
 RGB1 += Inc1
 RGB2 += Inc2
 RGB3 += Inc3
 If RGB1 <= 0
  RGB1 = 0
  Inc1 = Random(30)+1
 EndIf
 If RGB1 >= 255
  RGB1 = 255
  Inc1 = Random(30)+1
  Inc1 = Inc1 * -1
 EndIf
 If RGB2 <= 0
  RGB2 = 0
  Inc2 = Random(30)+1
 EndIf
 If RGB2 >= 255
  RGB2 = 255
  Inc2 = Random(30)+1
  Inc2 = Inc2 * (-1)
 EndIf
 If RGB3 <= 0
  RGB3 = 0
  Inc3 = Random(30)+1
 EndIf
 If RGB3 >= 255
  RGB3 = 255
  Inc3 = Random(3)+1
  Inc3 = Inc3 * -1
 EndIf
 Wait 10
Loop
'show the mouse
Window Cursor = True
EndWindow