1 rem Basic Drag Racer Dual 2 rem Made By: Kojoe 3 rem edited by: 10 termt 1 11 let a=0 12 let e=0 //opponent color 13 let f=0 //opponent speed 14 let o=0 //opponent distance 15 let p=0 //my colo 16 let s=0 //my speed 17 let d=0 //my distance 18 let r=0 //my rpm 19 let g=0 //my gear 20 let u=0 //user input 21 let w=rnd 1000 22 let l=0 23 let n=0 //magic number 24 let x=0 25 let y=0 26 let c=0 30 w = w+2000 40 ptl "Get Ready To Race!!" 50 ptl "First select your car color" 60 p=input " from 1 to 4: " 70 p =p-48 80 tune 0,0,60+p,200 90 uout p 100 e=kin 1 110 ptl "Dont forget to shift gear by pressing 0 to 6" 120 ptl "Get Ready" 130 wait 1000 140 cur 0 150 termt 0 160 clrscr 165 rem background fill 170 color 8,8 180 for i=0 to 320 190 for j=0 to 240 200 sxy i,j 210 char 254 220 next j 230 next i 240 color 7,7 250 for i=20 to 280 260 for j=20 to 200 270 sxy i,j 280 char 254 290 next j 300 next i 310 termup 320 wait w 325 rem color change Start of Race 330 color 10,10 340 for i=0 to 320 350 for j=205 to 240 360 sxy i,j 370 char 254 380 next j 390 next i 400 termup 405 rem Loop to here and sync both device 406 d=d+s 410 uout s 420 f=uin 1 430 o=o+f 440 if f=255 then goto 2040 450 if s=255 then goto 2130 460 if d>4740 then gosub 1910 470 c=e 480 x=f-d+160 490 y=70 500 if x<20 then gosub 1810 510 if x<275 then gosub 900 520 if x>275 then gosub 1810 530 c=p 540 x=160 550 y=30 560 gosub 900 570 gosub 1510 580 gosub 1670 590 termup 595 rem Game Speed and screen refresh rate 600 wait 100 610 u=kin 0 620 if u<48 then goto 670 630 if u>54 then goto 670 640 g=u-48 650 a=0 660 u=0 670 n=s+a 680 a=7-g+a 690 if g*50>n then goto 730 700 s=s+a 710 a=0 720 if s>254 then s=254 730 if g*50+30>n then s=s-10 740 if d<5000 then s=255 750 goto 406 755 rem draw car 900 color c,7 910 for i=x to x+13 920 for j=y-3 to y+3 930 sxy i,j 940 char 254 950 next j 960 next i 970 sxy x+13,y-3 980 char 32 990 sxy x+13,y-3 1000 char 32 1010 for i=y-2 to y+2 1020 sxy x+14,i 1030 char 254 1040 next i 1050 color c+8,7 1060 for i=x to x+13 1070 for j=y-1 to y+1 1080 sxy i,j 1090 char 254 1100 next j 1110 next i 1120 color 0,7 1130 for i=x+1 to x+3 1140 sxy x, y-4 1150 char 254 1160 sxy x, y+4 1170 char 254 1180 next i 1190 for i=x+8 to x+11 1200 sxy x, y-4 1210 char 254 1220 sxy x, y+4 1230 char 254 1240 next i 1250 for i=x+4 to x+5 1260 sxy x, y-3 1270 char 254 1280 sxy x, y+3 1290 char 254 1300 next i 1310 for i=y-1 to y+1 1320 sxy x+2,i 1330 char 254 1340 next i 1350 for i=x+8 to x+10 1360 for j=y-3 to y+3 1370 sxy i,j 1380 char 254 1390 next j 1400 next i 1410 sxy x+10,y-3 1420 char 254 1430 sxy x+10,y+3 1440 char 254 1450 return 1500 rem draw the middle white line 1510 y=55 1520 color 15,7 1530 for i=20 to 280 1540 l=(d+i)%10 1550 sxy 20+i,y 1560 char 32 1570 if l<0 then next i 1580 for j=0 to 5 1590 sxy 20+i+j,y 1600 char 254 1610 next j 1620 i=i+5 1630 if i>280 then i=280 1640 next i 1650 return 1660 rem draw the left gauge 1670 color 5,8 1680 for i=0 to 20 1690 for j=30 to n/2+30 1700 sxy i,j 1710 char 254 1720 next j 1730 for j=n/2+30 to 180 1740 sxy i,j 1750 char 32 1760 next j 1770 next i 1780 return 1800 rem fill opponent line 1810 color 7,7 1820 for i=20 to 280 1830 for j=y-10 to y+10 1840 sxy i,j 1850 char 254 1860 next j 1870 next i 1880 return 1900 rem draw finish line 1910 color 8,7 1920 x=5000-dc 1930 for i=0 to 40 1940 for j=0 to 60 1950 sxy x+i,y+j 1960 char 254 1970 sxy x+i,y-j 1980 char 254 1990 next j 2000 next i 2010 return 2030 rem when you loose 2040 color 12,12 2050 for i=0 to 320 2060 for j=205 to 240 2070 sxy i,j 2080 char 254 2090 next j 2100 next i 2110 goto 10 2120 rem when you win 2130 color 10,10 2140 for i=0 to 320 2150 for j=205 to 240 2160 sxy i,j 2190 char 254 2200 next j 2210 next i 2220 goto 10