'=========================================================================== ' Subject: RDRAWPRO (LIKE TURTLE DRAW) Date: 12-19-97 (17:34) ' Author: Richard Colletta Code: QB, QBasic, PDS ' Origin: riley007@hotmail.com Packet: GRAPHICS.ABC '=========================================================================== 'RDRAWPRO 'EMAIL ME! 'Send me your cool programs! 'Please read the RDRAWPRO.TXT file! 'Draw a grid ' FOR X = 110 TO 500 STEP GridSize ' LINE (X, 2)-(X, 386), GridColr ' LINE (110, X - 108)-(494, X - 108), GridColr ' NEXT CHDIR "c:\tools\grafix" SCREEN 0: CLS COLOR 13: PRINT "RDRAW FOR QBASIC by Richard Colletta 1997" COLOR 15: INPUT "PICTURE NAME: ", file$ file$ = file$ + ".Bas" OPEN file$ FOR OUTPUT AS #1 PRINT #1, "'RDRAW FOR QBASIC by Richard Colletta 1997" PRINT #1, "'FILE: "; file$ PRINT #1, "'Use Dim, Get, and Put" PRINT #1, "'For help read RDRAW.DOC" PRINT #1, "'EMAIL ME AT RILEY007@HOTMAIL.COM" PRINT #1, "SCREEN 13" 1 CLS COLOR 13: PRINT "RDRAW MENU" COLOR 15: PRINT "SELECT OPTION" COLOR 9: PRINT "1) DRAW" COLOR 9: PRINT "2) HELP" COLOR 9: PRINT "3) QUIT" 2 ans$ = INKEY$ IF ans$ = "1" THEN GOTO rdraw IF ans$ = "2" THEN GOSUB help: CLS : GOTO 1 IF ans$ = "3" THEN COLOR 13: PRINT "BYE!": COLOR 9: PRINT "EMAIL ME AT RILEY007@HOTMAIL.COM": END GOTO 2 'Main program rdraw: CLS : SCREEN 13 DIM box(1 TO 3000) AS INTEGER FOR x = 1 TO 70 PSET (x, 1) NEXT FOR y = 1 TO 70 PSET (x, y) NEXT FOR x = 1 TO 70 PSET (x, 70) NEXT FOR y = 1 TO 70 PSET (1, y) NEXT GET (1, 1)-(72, 72), box CLS DIM dot(0 TO 200) AS INTEGER PSET (2, 2), 8: PSET (3, 3), 14: PSET (4, 4), 14: PSET (5, 5), 14: PSET (6, 6), 13 GET (1, 1)-(10, 10), dot CLS x = 100: y = 100 dx = 100: dy = 100 col = 1 PUT (x, y), dot pcol = 1 bcol = 1 crad = 1 3 LOCATE 22, 1: COLOR col: PRINT x; y; col: 'COLOR pcol: PRINT "P"; pcol: LOCATE 21, 1: COLOR bcol: PRINT "B"; bcol: LOCATE 21, 15: COLOR pcol: PRINT "P"; pcol LOCATE 21, 7: COLOR 15: PRINT "C"; crad ans$ = INKEY$ IF ans$ = "u" AND crad > 0 OR ans$ = "U" AND crad > 0 THEN crad = crad - 1: IF ans$ = "i" OR ans$ = "I" THEN crad = crad + 1 IF ans$ = "p" AND bcol < 255 OR ans$ = "P" AND bcol < 255 THEN bcol = bcol + 1 IF ans$ = "o" AND bcol > 0 OR ans$ = "O" AND bcol > 0 THEN bcol = bcol - 1 IF ans$ = "p" AND bcol = 255 OR ans$ = "P" AND bcol = 255 THEN bcol = 0 IF ans$ = "o" AND bcol = 0 OR ans$ = "O" AND bcol = 0 THEN bcol = 255 IF ans$ = "]" AND pcol < 255 THEN pcol = pcol + 1 IF ans$ = "[" AND pcol > 0 THEN pcol = pcol - 1 IF ans$ = "]" AND pcol = 255 THEN pcol = 0 IF ans$ = "[" AND pcol = 0 THEN pcol = 255 IF ans$ = "+" AND col = 255 THEN col = 0: newcol = 1 IF ans$ = "-" AND col = 0 THEN col = 255: newcol = 1 IF ans$ = "+" AND col < 255 THEN col = col + 1 IF ans$ = "-" AND col > 0 THEN col = col - 1 IF ans$ = "8" THEN GOSUB dot: y = y - 1: PUT (x, y), dot: PRINT #1, "PSET ("; x; ","; y; ")"; ","; col: PSET (x, y), col: IF ans$ = "2" THEN GOSUB dot: y = y + 1: PUT (x, y), dot: PRINT #1, "PSET ("; x; ","; y; ")"; ","; col: PSET (x, y), col IF ans$ = "4" THEN GOSUB dot: x = x - 1: PUT (x, y), dot: PRINT #1, "PSET ("; x; ","; y; ")"; ","; col: PSET (x, y), col IF ans$ = "6" THEN GOSUB dot: x = x + 1: PUT (x, y), dot: PRINT #1, "PSET ("; x; ","; y; ")"; ","; col: PSET (x, y), col IF ans$ = "9" THEN GOSUB dot: x = x + 1: y = y - 1: PUT (x, y), dot: PRINT #1, "PSET ("; x; ","; y; ")"; ","; col: PSET (x, y), col IF ans$ = "3" THEN GOSUB dot: x = x + 1: y = y + 1: PUT (x, y), dot: PRINT #1, "PSET ("; x; ","; y; ")"; ","; col: PSET (x, y), col IF ans$ = "1" THEN GOSUB dot: x = x - 1: y = y + 1: PUT (x, y), dot: PRINT #1, "PSET ("; x; ","; y; ")"; ","; col: PSET (x, y), col IF ans$ = "7" THEN GOSUB dot: x = x - 1: y = y - 1: PUT (x, y), dot: PRINT #1, "PSET ("; x; ","; y; ")"; ","; col: PSET (x, y), col IF ans$ = "w" OR ans$ = "W" THEN GOSUB dot: y = y - 1: PUT (x, y), dot IF ans$ = "x" OR ans$ = "X" THEN GOSUB dot: y = y + 1: PUT (x, y), dot IF ans$ = "a" OR ans$ = "A" THEN GOSUB dot: x = x - 1: PUT (x, y), dot IF ans$ = "d" OR ans$ = "D" THEN GOSUB dot: x = x + 1: PUT (x, y), dot IF ans$ = "5" THEN PAINT (x, y), pcol, bcol: PRINT #1, "paint ("; x; ","; y; ")"; ","; pcol; ","; bcol: PUT (x, y), dot: IF ans$ = "f" OR ans$ = "F" THEN PUT (1, 1), box: PUT (73, 1), box: PUT (145, 1), box: PUT (217, 1), box: PUT (1, 72), box: PUT (73, 72), box: PUT (145, 72), box: PUT (217, 72), box IF ans$ = "C" OR ans$ = "c" THEN CIRCLE (x, y), crad, col: PRINT #1, "CIRCLE " + "("; x; ","; y; ")"; ","; crad; ","; col IF ans$ = CHR$(27) THEN COLOR 13: PRINT "BYE!": COLOR 9: PRINT "EMAIL ME AT RILEY007@HOTMAIL.COM": END GOTO 3 help: CLS : SCREEN 0 COLOR 13: PRINT "RDRAW HELP" COLOR 15: PRINT "(+/-) These are used to change color" PRINT "Use number pad to draw. NumLock should be on." PRINT "(*) This is used to toggle between move mode and draw mode" PRINT "To move without drawing controls are:" PRINT "W: Up X: Down A:left D:right" PRINT "Toggle paint fill color: [ , ]" PRINT "Toggle paint border color: O, P" PRINT "Press U to decrease circle radius." PRINT "Press I to increase circle radius." PRINT "Press C to make a circle" PRINT "Press F to toggle sprite frames on/off." PRINT "Press escape to quit. Saving is automatic." PRINT "Press any key to exit help" PRINT "Richard Colletta 1997" SLEEP RETURN dot: PUT (x, y), dot RETURN