'=========================================================================== ' Subject: MOUSE DRIVEN TRIANGLE Date: 10-29-96 (00:06) ' Author: Nicolas Culberson Code: QB, PDS ' Origin: exnihilo@rhunebbs.com Packet: MISC.ABC '=========================================================================== 'Ok... this program doesn't ACTUALLY do anything. It's the result of a lack 'of INTERNET connection combined with boredom and visiting relatives you 'don't want to know you are home. 'You need a mouse... a computer... some memory... a little hard-drive... 'patience... boredom... the default library... the real QUICKBASIC. 'Load up QuickBASIC by typing "QB/L" this loads the default library... 'You can use this however you like... I really don't care... 'If you make money off of it... pay me... I'm broke. 'If you at least bother to look at it... 'send me an e-mail... 'exnihilo@rhunebbs.com. 'Send me the latest ABC packet. 'Send me your funky code. 'Send me a life. 'All code by NICOLAS CULBERSON. 'This program intentionally bounces around like that! Oh yeah, and it was 'created on a 486/33 so if it doesn't work right on your computer don't 'tell me about it. I don't care. DECLARE SUB warp () 'Declare stuff... DECLARE SUB right () 'Declare stuff... DECLARE SUB down () 'Declare stuff... DECLARE SUB up () 'Declare stuff... DECLARE SUB left () 'Declare stuff... DECLARE SUB shoot () 'Declare stuff... REM $INCLUDE: 'QB.BI' 'Include the library thing... DIM SHARED regx AS RegTypeX'Dim regx as regtypex and share it between the 'subs(see "Declare stuff...") DIM SHARED a, b 'Do the same thing with the variables a,b RANDOMIZE TIMER 'This Randomizes the computer timer(duh) CLS 'Clear the screen. If you don't understand this 'statement... don't bother trying to figure the 'program out. You need a manual. SCREEN 13 'Put the screen into 320 * 200 graphics mode. a = regx.cx / 2 'Define the variable regx.cx '(the X AXIS on the mouse) as variable named a. 'You must divide by half in screen 13. b = regx.dx 'Do the same thing to the variable named b with 'the Y AXIS DO 'Begin LOOP(see LOOP) a$ = INKEY$ 'Look for a keypress and place it in STRING A$ IF a$ = CHR$(27) THEN END 'If the key pressed is "esc" then escape.(please '(note: this is high level programming, do not 'attempt to put such wonderful features in your 'own programs without adult supervision.) regx.ax = 2 'Hide the mouse cursor CALL INTERRUPTX(&H33, regx, regx) 'Call the mouse interrupt at the address '&H33... this works on most computers... regx.ax = 3 'I dunno what this does but it has to be 'there last time I checked. CALL INTERRUPTX(&H33, regx, regx) 'Call it again. REM IF regx.dx > 139 THEN regx.dx = regx.dx - 1 'This line is remmed... 'ignore it. IF a > regx.cx / 2 THEN CALL left 'Call the sub LEFT if the mouse 'moves in the left direction. IF a < regx.cx / 2 THEN CALL right 'Call the sub RIGHT if the mouse 'moves in the right direction. IF b > regx.dx THEN CALL up 'Call the sub UP if the mouse 'moves in the UP direction. IF b < regx.dx THEN CALL down 'Bear with me here... things do change. IF regx.bx = 1 THEN CALL shoot 'Regx.bx is the mouse button variable. '.bx=1 is button number 1 '.bx=2 is button number 2 '.bx=3 is button number 1 and 2 at the 'same time or button 3 if you have it, I 'think. 'So, this line checks for button 1... 'and if it is pressed, calls the sub 'named shoot. IF regx.bx = 2 THEN CALL warp 'If button 2 is pressed... 'call the WARP sub. LOOP UNTIL bob = 1 'Loop forever. Whose BOB? 'Hmmm... you're still reading eh? Your internet connection must be down too. 'How about calling Zeitgeist BBS in Saint John... the phone number is '(506)832-9012 or something like that. Experiment... you never know who you 'might get. When you get there... e-mail Ex Nihilo, or Beanpole, or 'Ebenezer. SUB down PSET (a, b), 0 'Delete the old one DRAW "e10f10l20" 'by drawing over top of it in black. b = b + 1 'Move the picture down 1. PSET (a, b), 12 'Redraw it. DRAW "e10f10l20" ' " " . PAINT (a + 3, b - 1), 14, 12 'Paint the yellow inside. END SUB 'End the Sub(pretty self explanatory) SUB left PSET (a, b), 0 'See SUB DOWN... it's the same thing. DRAW "e10f10l20" a = a - 1 PSET (a, b), 12 DRAW "e10f10l20" PAINT (a + 3, b - 1), 14, 12 END SUB SUB right PSET (a, b), 0 'See SUB DOWN it's the same thing... DRAW "e10f10l20" a = a + 1 PSET (a, b), 12 DRAW "e10f10l20" PAINT (a + 3, b - 1), 14, 12 END SUB SUB shoot LINE (a + 10, b - 13)-(a + 10, b - 50), 10 'Draw the green shooting line. FOR cool = 1 TO 100: NEXT cool 'Delay... LINE (a + 10, b - 13)-(a + 10, b - 50), 0 'Draw over top of the shooting 'line in black. END SUB SUB up PSET (a, b), 0 'See SUB DOWN. Same dif... DRAW "e10f10l20" b = b - 1 PSET (a, b), 12 DRAW "e10f10l20" PAINT (a + 3, b - 1), 14, 12 END SUB SUB warp PAINT (a + 3, b - 1), 0, 12 'This SUB drops the ship somewhere else. PSET (a, b), 0 'Figure it out each line by line for yourself... DRAW "e10f10l20" 'I'm sick of explaining every little thing... a = INT(RND * 300) b = INT(RND * 180) PSET (a, b), 12 DRAW "e10f10l20" PAINT (a + 3, b - 1), 14, 12 FOR cool = 1 TO 1000: NEXT cool END SUB