ScreenWidth = 800 ScreenHeight = 600 MyScreenSize = _NEWIMAGE(ScreenWidth, ScreenHeight, 256) SCREEN MyScreenSize DIM SlugX(16) DIM SlugY(16) DIM PrevSlugX(16) DIM PrevSlugY(16) DIM DiameterShift(16) DIM PrevDIA(16) DIM CircleDIA(16) DIM PreviousDistance(16) DIM Distance(16) DIM Hue(16) 'The DIM statements above this line are "dimension" statements. 'This is how you declare an array. I am using the same variables 'that I used in the other simpler program, but now I intend to 'include a total of sixteen circles. Sixteen is not a special 'number in this instance. It just sounded good to me. FOR h = 0 TO 15 Hue(h) = 15 NEXT h ' The for-next loop above this line serves no serious purpose. I ' gave each circle its own potential color with a variable called Hue(c). ' I have not used the feature yet. This for-next loop does nothing but ' assign the color white to each circle, for the moment. GOSUB SetupMouse GOSUB MouseHide GOSUB MouseStatus DO GOSUB MouseStatus K$ = INKEY$ GOSUB DrawSluggishCursors LOOP UNTIL K$ = CHR$(27) END 'Below is the subroutine which is the heart of this program. DrawSluggishCursors: FOR c = 0 TO 15 'This for-next loop is important. 'It guarantees that we run all 'procedures on each of the sixteen circles. 'Notice that we are using zero through fifteen. ' The code below is the same as in the simpler program ' with some small differences. PrevDIA(c) = CircleDIA(c) IF LB THEN CircleDIA(c) = CircleDIA(c) + .001 IF RB THEN CircleDIA(c) = CircleDIA(c) - .001 IF CircleDIA(c) > 200 THEN CircleDIA(c) = 200 IF CircleDIA(c) < 2 THEN CircleDIA(c) = 2 DiameterShift(c) = PrevDIA(c) - CircleDIA(c) PreviousDistance(c) = Distance(c) Distance(c) = SQR((SlugX(c) - MouseX) ^ 2 + (SlugY(c) - MouseY) ^ 2) IF c = 0 THEN XDistance = SlugX(c) - MouseX YDistance = SlugY(c) - MouseY ELSE XDistance = SlugX(c) - SlugX(c - 1) YDistance = SlugY(c) - SlugY(c - 1) END IF 'The IF/THEN/ELSE section above this line is important. 'The very first circle is treated the same as in the simpler program. ' All of the others, though, chase the PREVIOUS CIRCLE ' instead of the mouse cursor. PrevSlugX(c) = SlugX(c) PrevSlugY(c) = SlugY(c) SlugX(c) = SlugX(c) - XDistance * .0001 SlugY(c) = SlugY(c) - YDistance * .0001 ' I have used .0001 instead of .000001 here. ' There is a lot more happening now that we have more circles, ' and this speeds up the program. ' We COULD replace .0001 with a variable, and allow mouse buttons ' or function keys to adjust that number up or down on demand. ' This would give the user control over the speed. CIRCLE (PrevSlugX(c), PrevSlugY(c)), PrevDIA(c), 0 CIRCLE (SlugX(c), SlugY(c)), CircleDIA(c), Hue(c) NEXT c RETURN 'Mouse Stuff ****************************************** Mouse Stuff ************************* Mouse Stuff ***** SetupMouse: MOUSE$ = SPACE$(57): Mark$ = TIME$: DO: LOOP UNTIL Mark$ <> TIME$: Mark$ = TIME$ DO: Click = Click + 1: LOOP UNTIL Mark$ <> TIME$: DoubleClickSpeed = Click / 5000 RESTORE MOUSEDATA: FOR I% = 1 TO 57: READ a$: H$ = CHR$(VAL("&H" + a$)): MID$(MOUSE$, I%, 1) = H$: NEXT I%: RETURN MOUSEDATA: DATA 55,89,E5,8B,5E,0C,8B,07,50,8B,5E,0A,8B,07,50,8B DATA 5E,08,8B,0F,8B,5E,06,8B,17,5B,58,1E,07,CD,33,53 DATA 8B,5E,0C,89,07,58,8B,5E,0A,89,07,8B,5E,08,89,0F DATA 8B,5E,06,89,17,5D,CA,08,00 BUTTONTRAP: DO: GOSUB MouseStatus: LOOP UNTIL LB <> -1: RETURN MouseStatus: AX% = 3: GOSUB MouseDriver: LB = ((BX% AND 1) <> 0) RB = ((BX% AND 2) <> 0): MouseX = CX%: MouseY = DX%: XPos = INT(MouseX / 8) + 1: YPos = INT(MouseY / 16) + 1 IF NOT RB AND NOT LB THEN Trap = 0 IF FDC > DoubleClickSpeed THEN FDC = 0 IF FDC > 0 AND NOT LB AND NOT RB THEN FDC = FDC + 1 DC = 0 IF LB OR RB THEN IF FDC = 0 THEN FDC = 1 IF FDC > 2 AND MouseY = prevY AND MouseX = prevX THEN DC = 1: FDC = 0 END IF prevY = MouseY: prevX = MouseX IF Trap = 1 THEN RB = 0: LB = 0: RETURN MouseDriver: DEF SEG = VARSEG(MOUSE$): MOUSE% = SADD(MOUSE$): CALL ABSOLUTE(AX%, BX%, CX%, DX%, MOUSE%): RETURN MouseHide: AX% = 2: GOSUB MouseDriver: RETURN MouseShow: AX% = 1: GOSUB MouseDriver: RETURN 'End Mouse Stuff ************************************** End Mouse Stuff ************************* End Mouse Stuff