1 rem uBasic Catapult & Castle 2 rem Made By: Kojoe 3 rem edited by: 10 cls 20 cur 0 30 termt 0 40 rem variables for the map 50 let a=0 60 let b=0 70 let c=0 80 rem usefull temp var 90 let d=0 100 color 11,11 110 for i=1 to 318 120 for j=1 to 238 130 sxy i,j 140 chr 254 150 next j 160 next i 170 color 8,8 180 a=rnd 240 190 a=a+40 200 b=rnd 200 210 for i=1 to a 220 for j=1 to b 230 sxy i,j 240 chr 254 250 next j 260 next i 270 c=rnd 160 280 for i=a to 318 290 for j=1 to c 300 sxy i,j 310 chr 254 320 next j 330 next i 340 termup 350 rem catapult var 360 let e=0 370 rem castle var 380 let f=0 390 d=a-60 400 e=rnd d 410 e=d+40 420 d=318-a 430 f=rnd d 440 f=f+a-40 450 d=a+40 460 if f 318 then goto 600 730 if m < f-20 then goto 770 740 if m > f+20 then goto 770 750 if n > cy then goto 770 760 goto 830 770 if m > a then goto 800 780 if n < b then goto 600 790 if m > a then goto 810 800 if n < c then goto 600 810 n=n-g 820 goto 650 830 sxy 100,100 840 ptl "You won" 845 termup 850 goto 10 860 rem draw the catapult 870 color 2,2 880 d=b+1 890 for i=0 to 3 900 for j=0 to 20 910 sxy e+j,b+i 920 char 254 930 next j 940 for j=0 to 16 950 sxy e+14+i,b+j 960 next j 970 next i 980 for i=0 to 7 990 for j=0 to 2 1000 for k=0 to 2 1010 sxy e+8+i+j,b+j+k 1020 char 254 1030 next k 1040 next j 1050 next i 1060 ret 1070 rem draw the castle 1080 color 4,4 1090 for i=f-20 to f+20 1100 for j=c-1 to c 1110 sxy i,j 1120 char 254 1130 next j 1140 next i 1150 color 7,7 1160 for i=f-20 to f+20 1170 sxy i,d 1180 char 254 1190 next i 1200 for i=f-20 to f+20 1210 for j=c to c+25 1220 sxy i,j 1230 char 254 1240 next j 1250 next i 1260 for i=f-15 to f+15 1270 for j=c+25 to c+50 1280 sxy i,j 1290 char 254 1300 next j 1310 next i 1320 for i=f-10 to f+10 1330 for j=c+50 to c+65 1340 sxy i,j 1350 char 254 1360 next j 1370 next i 1380 ret