'=========================================================================== ' Subject: CANYON RACE DEMO (TEXT-ONLY) Date: 01-20-99 (17:20) ' Author: The ABC Programmer Code: BEC ' Origin: voxel@edmc.net Packet: BASEC.ABC '=========================================================================== ' River race like demonstration, for BASEC v0.15 [DOS] 'Variable list for canyon.bas DIM INTENSITY AS INTEGER DIM X% AS INTEGER DIM SPEED! AS SINGLE DIM P1X AS INTEGER DIM P1Y AS INTEGER DIM P2X AS INTEGER DIM P2Y AS INTEGER DIM LWALL AS INTEGER DIM RWALL AS INTEGER DIM MOVE$ AS STRING DIM WALLMOVE AS INTEGER DIM CRUSHEM AS INTEGER DIM SCORE% AS INTEGER DIM T! AS SINGLE '=========================================================================== ' Subject: CANYON Date: 10-11-97 (18:38) ' Author: Chris Gunn Code: QB, QBasic, PDS ' Origin: Aaron Tucker Packet: DEMOS.ABC '=========================================================================== '/\_/\ CANYON.BAS /\_/\ Hail to the Commodore PET! RANDOMIZE TIMER intensity = 3 ' 2 speed demon 3 default 4 lazy ' 5 slow poke 6 grandma 7 snail DIM Course(25) AS STRING * 80 COLOR 12, 0 FOR X% = 1 TO 25 Course(X%) = "º" + SPACE$(78) + "º" LOCATE 24, 1: PRINT Course(X%) NEXT X% Speed! = .1 ' 500 whoosh! 1000 wheee! 1500 cool! ' 2000 ok 2500 3000 Commodore PET ' 3500 <- baud 4000 zzzzz... ' 3000+ would be fun with obstacles.. ' P1Alive = 0 : P2Alive = 0 'not yet implemented p1x = 33: p1y = 8 'Player 1's X and Y position p2x = 38: p2y = 8 'Player 2's X and Y position LWall = 20 'Left Wall X position RWall = 50 'Right Wall X position DO Move$ = INKEY$ IF LEN(Move$) THEN IF Move$ = CHR$(9) THEN Speed! = Speed! - .01 ' Speed up IF Move$ = CHR$(0) + CHR$(15) THEN Speed! = Speed! + .01 ' ' Player 1 Shift AZ (up and down) <> (left and right) IF Move$ = "," THEN IF p1x > 1 THEN p1x = p1x - 1 END IF IF Move$ = "." THEN IF p1x < 79 THEN p1x = p1x + 1 END IF ' Player 2 Shift 85 (up and down) 46 (left and right) IF Move$ = "4" THEN IF p2x > 1 THEN p2x = p2x - 1 END IF IF Move$ = "6" THEN IF p2x < 79 THEN p2x = p2x + 1 END IF ELSE ' Leave player in same column END IF ' Print screen LOCATE p1y, p1x: COLOR 14, 1: PRINT "1" LOCATE p2y, p2x: COLOR 8, 1: PRINT "2" wallmove = INT(RND * intensity) + 1 IF wallmove = 1 AND LWall > 1 THEN LWall = LWall - 1: RWall = RWall - 1 IF wallmove = 2 AND RWall < 75 THEN LWall = LWall + 1: RWall = RWall + 1 ' !! !! walls go in and out...neat huh? CrushEm = INT(RND * 100) + 1 IF CrushEm < 15 AND LWall <> 1 THEN LWall = LWall - 1: RWall = RWall + 1 'IF CrushEm < 15 THEN SOUND 1525, .5 IF CrushEm > 74 AND RWall <> 75 THEN LWall = LWall + 1: RWall = RWall - 1 'IF CrushEm > 74 THEN SOUND 541, .5 IF Move$ = "\" THEN SLEEP ' IF LWall + 2 = RWall THEN GOTO GameOver IF MID$(Course(p1y), p1x, 1) > "9" THEN GOTO GameOver IF MID$(Course(p2y), p2x, 1) > "9" THEN GOTO GameOver IF MID$(Course(p1y), p1x, 1) = "2" THEN GOTO GameOver IF MID$(Course(p2y), p2x, 1) = "1" THEN GOTO GameOver Course(25) = "º" + SPACE$(78) + "º" FOR X% = 1 TO 24 SWAP Course(X%), Course(X% + 1) ' Move everything up NEXT X% Course(23) = LEFT$(Course(23),LWall) + "²±°" + MID$(Course(23),LWall+4,80) Course(23) = LEFT$(Course(23),RWall) + "°±²" + MID$(Course(23),RWall+4,80) IF MID$(Course(p1y), p1x, 1) = " " THEN Course(p1y+1) = LEFT$(Course(ply+1),p1x-1) + "1" + MID$(Course(p1y+1),p1x+1,80) END IF IF MID$(Course(p2y), p2x, 1) = " " THEN Course(p2y+1) = LEFT$(Course(p2y+1),p2x-1) + "2" + MID$(Course(p2y+1),p2x+1,80) END IF 'IF LWall > 1 THEN LOCATE 24, LWall: COLOR 12, 0: PRINT "[" 'IF RWall < 75 THEN LOCATE 23, RWall: COLOR 12, 0: PRINT "[" COLOR 12, 0 LOCATE 24, 1: PRINT Course(23) Score% = Score% + 1 ' Control the loop timing ' FOR DelayPause = 1 TO speed: NEXT DelayPause T! = TIMER DO LOOP UNTIL TIMER-T! > Speed! LOOP UNTIL Move$ = CHR$(27) GameOver: LOCATE 24, 1: COLOR 15, 4: PRINT "--SPLAT-- Score: "; Score% COLOR 7,0: ? END