'=========================================================================== ' Subject: STAR WARS SPACETEXT Date: 09-13-97 (15:55) ' Author: Alex Warren Code: QB, QBasic, PDS ' Origin: comp.lang.basic.misc Packet: GRAPHICS.ABC '=========================================================================== 'Here is a program I made a while ago that makes text scroll into the 'distance, as in sci-fi films/tv programmes. It looks quite good, but 'it is veeeeery sloooow. 'If anyone can find anyway of speeding it up, I would be very pleased 'to know. 'Meanwhile, for more QB programs visit my BASIC page at 'http://www.users.globalnet.co.uk/~dewarr/basic.htm DECLARE FUNCTION surndpoint% (x%, y%) DEFINT A-Z DIM p(192, 64), sp(192, 64) SCREEN 12 PRINT "Star Wars SpaceText v1.0" PRINT "(c) Alex Warren May 1997" PRINT "email: aliwarren@aol.com" PRINT "Graphical pointlessness" LOCATE 10, 2: PRINT "Scan 1: Calculating Special Effects" FOR x = 1 TO 192 FOR y = 1 TO 64 IF POINT(x, y) <> 0 THEN sp(x, y) = surndpoint(x, y) NEXT y NEXT x LOCATE 10, 2: PRINT "Scan 2: Adding Special Effects " FOR x = 1 TO 192 FOR y = 1 TO 64 sp = sp(x, y) IF sp < 6 AND sp > 3 THEN PSET (x, y), 7 IF sp < 4 AND sp <> 0 THEN PSET (x, y), 8 NEXT y NEXT x LOCATE 10, 2: PRINT "Scan 3: Reading points " FOR x = 1 TO 192 FOR y = 1 TO 64 p(x, y) = POINT(x, y) NEXT y NEXT x CLS cs = 0 FOR y = 265 TO 32 STEP -1 SCREEN 7, , cs, 1 - cs LINE (0, 0)-(320, 200), 0, BF FOR xx = 1 TO 192 FOR yy = 1 TO 64 IF p(xx, yy) <> 0 THEN ' The next two lines are the only ones that REALLY do anything in this program nx = (((xx - 96) * ((y - (64 - yy)) / 320)) * 2) + 160 ny = (y - ((16 - yy) * (y / 320))) - 50 ' Great eh? PSET (nx, ny), p(xx, yy) PSET (nx + 1, ny), p(xx, yy) END IF NEXT yy NEXT xx cs = 1 - cs NEXT y FUNCTION surndpoint (x, y) sp = 0 FOR xx = -1 TO 1 FOR yy = -1 TO 1 IF POINT(x + xx, y + yy) <> 0 THEN sp = sp + 1 NEXT yy NEXT xx surndpoint = sp END FUNCTION