Home » Personal collection » Acorn ADFS disks » Greaseweazled » dfs_box04_disk02b_eug_scripts.adf » PT4/P/+BB2
PT4/P/+BB2
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Personal collection » Acorn ADFS disks » Greaseweazled » dfs_box04_disk02b_eug_scripts.adf |
Filename: | PT4/P/+BB2 |
Read OK: | ✔ |
File size: | 06B6 bytes |
Load address: | 0000 |
Exec address: | FFFFFFFF |
Duplicates
There are 2 duplicate copies of this file in the archive:
- Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_39.ADF » P/+BB2
- Personal collection » Acorn ADFS disks » Greaseweazled » dfs_box04_disk02b_eug_scripts.adf » PT4/P/+BB2
- Personal collection » Acorn hard disk » zipped_disks » elk03 » eug39/P/+BB2
File contents
[Standard first two lines of a UDCMod based program] 10 MODE2:HIMEM=&2C00:PROCasschar 20 REM Put your program code here! [Set EOR paint style so that ball can easily be erased] 30 PROCsetpaint(3) [Set up array which stores which blocks have been hit by ball] 40 DIMblock(19,9) [Draw blocks at top of the screen] 50 ?xoff=0:?yoff=0:FORx=0TO19:FORy=0TO9:?char=1+RND(2):?xc=x:?yc=y: CALLdisplay:NEXT:NEXT [Set initial position of ball] 60 xball=37:yball=100:up=FALSE:left=FALSE [and of the bat...] 70 xbat=9 [Draw bat in initial position] 80 ?char=4:?xc=9:?yc=30:?xoff=0:?yoff=0:CALLdisplay:?xc=10:?char=5: CALLdisplay [and ball as well...] 90 ?char=0:?xc=xball DIV4:?yc=yball DIV8:?xoff=xball AND3:?yoff=yball AND7:CALLdisplay [Finished setting up, so start main loop] 100 REPEAT [Move ball and put new position in (xnew,ynew)] 110 IF left THEN xnew=xball-2 ELSE xnew=xball+2 120 IF up THEN ynew=yball-4 ELSE ynew=yball+4 [Bouncing off top of screen?] 130 IF ynew<4 THEN up=FALSE [If bounce off bottom of screen, beep, wait for space, and put ball back in initial position] 140 IF ynew=248 THEN VDU7:REPEAT UNTIL INKEY(-99):xnew=37:ynew=100 [Bouncing off left/right of screen?] 150 IF xnew=1 THEN left=FALSE 160 IF xnew=75 THEN left=TRUE [Erase old picture of ball] 170 ?char=0:?xc=xball DIV4:?yc=yball DIV8:?xoff=xball AND3:?yoff=yball AND7:CALLdisplay [and replace with new picture of ball] 180 xball=xnew:yball=ynew 190 ?char=0:?xc=xball DIV4:?yc=yball DIV8:?xoff=xball AND3:?yoff=yball AND7:CALLdisplay [Bouncing off bat?] 200 IF yball=232 AND (xball>(xbat-2)*4) AND (xball<(xbat+2)*4) THEN up=TRUE
00000000 5b 53 74 61 6e 64 61 72 64 20 66 69 72 73 74 20 |[Standard first | 00000010 74 77 6f 20 6c 69 6e 65 73 20 6f 66 20 61 20 55 |two lines of a U| 00000020 44 43 4d 6f 64 20 62 61 73 65 64 20 70 72 6f 67 |DCMod based prog| 00000030 72 61 6d 5d 0d 0d 20 20 20 31 30 20 4d 4f 44 45 |ram].. 10 MODE| 00000040 32 3a 48 49 4d 45 4d 3d 26 32 43 30 30 3a 50 52 |2:HIMEM=&2C00:PR| 00000050 4f 43 61 73 73 63 68 61 72 0d 20 20 20 32 30 20 |OCasschar. 20 | 00000060 52 45 4d 20 50 75 74 20 79 6f 75 72 20 70 72 6f |REM Put your pro| 00000070 67 72 61 6d 20 63 6f 64 65 20 68 65 72 65 21 0d |gram code here!.| 00000080 0d 5b 53 65 74 20 45 4f 52 20 70 61 69 6e 74 20 |.[Set EOR paint | 00000090 73 74 79 6c 65 20 73 6f 20 74 68 61 74 20 62 61 |style so that ba| 000000a0 6c 6c 20 63 61 6e 20 65 61 73 69 6c 79 20 62 65 |ll can easily be| 000000b0 20 65 72 61 73 65 64 5d 0d 0d 20 20 20 33 30 20 | erased].. 30 | 000000c0 50 52 4f 43 73 65 74 70 61 69 6e 74 28 33 29 0d |PROCsetpaint(3).| 000000d0 0d 5b 53 65 74 20 75 70 20 61 72 72 61 79 20 77 |.[Set up array w| 000000e0 68 69 63 68 20 73 74 6f 72 65 73 20 77 68 69 63 |hich stores whic| 000000f0 68 20 62 6c 6f 63 6b 73 20 68 61 76 65 20 62 65 |h blocks have be| 00000100 65 6e 20 68 69 74 20 62 79 20 62 61 6c 6c 5d 0d |en hit by ball].| 00000110 0d 20 20 20 34 30 20 44 49 4d 62 6c 6f 63 6b 28 |. 40 DIMblock(| 00000120 31 39 2c 39 29 0d 0d 5b 44 72 61 77 20 62 6c 6f |19,9)..[Draw blo| 00000130 63 6b 73 20 61 74 20 74 6f 70 20 6f 66 20 74 68 |cks at top of th| 00000140 65 20 73 63 72 65 65 6e 5d 0d 0d 20 20 20 35 30 |e screen].. 50| 00000150 20 3f 78 6f 66 66 3d 30 3a 3f 79 6f 66 66 3d 30 | ?xoff=0:?yoff=0| 00000160 3a 46 4f 52 78 3d 30 54 4f 31 39 3a 46 4f 52 79 |:FORx=0TO19:FORy| 00000170 3d 30 54 4f 39 3a 3f 63 68 61 72 3d 31 2b 52 4e |=0TO9:?char=1+RN| 00000180 44 28 32 29 3a 3f 78 63 3d 78 3a 3f 79 63 3d 79 |D(2):?xc=x:?yc=y| 00000190 3a 0d 20 20 20 20 20 20 43 41 4c 4c 64 69 73 70 |:. CALLdisp| 000001a0 6c 61 79 3a 4e 45 58 54 3a 4e 45 58 54 0d 0d 5b |lay:NEXT:NEXT..[| 000001b0 53 65 74 20 69 6e 69 74 69 61 6c 20 70 6f 73 69 |Set initial posi| 000001c0 74 69 6f 6e 20 6f 66 20 62 61 6c 6c 5d 0d 0d 20 |tion of ball].. | 000001d0 20 20 36 30 20 78 62 61 6c 6c 3d 33 37 3a 79 62 | 60 xball=37:yb| 000001e0 61 6c 6c 3d 31 30 30 3a 75 70 3d 46 41 4c 53 45 |all=100:up=FALSE| 000001f0 3a 6c 65 66 74 3d 46 41 4c 53 45 0d 0d 5b 61 6e |:left=FALSE..[an| 00000200 64 20 6f 66 20 74 68 65 20 62 61 74 2e 2e 2e 5d |d of the bat...]| 00000210 0d 0d 20 20 20 37 30 20 78 62 61 74 3d 39 0d 0d |.. 70 xbat=9..| 00000220 5b 44 72 61 77 20 62 61 74 20 69 6e 20 69 6e 69 |[Draw bat in ini| 00000230 74 69 61 6c 20 70 6f 73 69 74 69 6f 6e 5d 0d 0d |tial position]..| 00000240 20 20 20 38 30 20 3f 63 68 61 72 3d 34 3a 3f 78 | 80 ?char=4:?x| 00000250 63 3d 39 3a 3f 79 63 3d 33 30 3a 3f 78 6f 66 66 |c=9:?yc=30:?xoff| 00000260 3d 30 3a 3f 79 6f 66 66 3d 30 3a 43 41 4c 4c 64 |=0:?yoff=0:CALLd| 00000270 69 73 70 6c 61 79 3a 3f 78 63 3d 31 30 3a 3f 63 |isplay:?xc=10:?c| 00000280 68 61 72 3d 35 3a 0d 20 20 20 20 20 20 43 41 4c |har=5:. CAL| 00000290 4c 64 69 73 70 6c 61 79 0d 0d 5b 61 6e 64 20 62 |Ldisplay..[and b| 000002a0 61 6c 6c 20 61 73 20 77 65 6c 6c 2e 2e 2e 5d 0d |all as well...].| 000002b0 0d 20 20 20 39 30 20 3f 63 68 61 72 3d 30 3a 3f |. 90 ?char=0:?| 000002c0 78 63 3d 78 62 61 6c 6c 20 44 49 56 34 3a 3f 79 |xc=xball DIV4:?y| 000002d0 63 3d 79 62 61 6c 6c 20 44 49 56 38 3a 3f 78 6f |c=yball DIV8:?xo| 000002e0 66 66 3d 78 62 61 6c 6c 20 41 4e 44 33 3a 3f 79 |ff=xball AND3:?y| 000002f0 6f 66 66 3d 79 62 61 6c 6c 0d 20 20 20 20 20 20 |off=yball. | 00000300 41 4e 44 37 3a 43 41 4c 4c 64 69 73 70 6c 61 79 |AND7:CALLdisplay| 00000310 0d 0d 5b 46 69 6e 69 73 68 65 64 20 73 65 74 74 |..[Finished sett| 00000320 69 6e 67 20 75 70 2c 20 73 6f 20 73 74 61 72 74 |ing up, so start| 00000330 20 6d 61 69 6e 20 6c 6f 6f 70 5d 0d 0d 20 20 31 | main loop].. 1| 00000340 30 30 20 52 45 50 45 41 54 0d 0d 5b 4d 6f 76 65 |00 REPEAT..[Move| 00000350 20 62 61 6c 6c 20 61 6e 64 20 70 75 74 20 6e 65 | ball and put ne| 00000360 77 20 70 6f 73 69 74 69 6f 6e 20 69 6e 20 28 78 |w position in (x| 00000370 6e 65 77 2c 79 6e 65 77 29 5d 0d 0d 20 20 31 31 |new,ynew)].. 11| 00000380 30 20 49 46 20 6c 65 66 74 20 54 48 45 4e 20 78 |0 IF left THEN x| 00000390 6e 65 77 3d 78 62 61 6c 6c 2d 32 20 45 4c 53 45 |new=xball-2 ELSE| 000003a0 20 78 6e 65 77 3d 78 62 61 6c 6c 2b 32 0d 20 20 | xnew=xball+2. | 000003b0 31 32 30 20 49 46 20 75 70 20 54 48 45 4e 20 79 |120 IF up THEN y| 000003c0 6e 65 77 3d 79 62 61 6c 6c 2d 34 20 45 4c 53 45 |new=yball-4 ELSE| 000003d0 20 79 6e 65 77 3d 79 62 61 6c 6c 2b 34 0d 0d 5b | ynew=yball+4..[| 000003e0 42 6f 75 6e 63 69 6e 67 20 6f 66 66 20 74 6f 70 |Bouncing off top| 000003f0 20 6f 66 20 73 63 72 65 65 6e 3f 5d 0d 0d 20 20 | of screen?].. | 00000400 31 33 30 20 49 46 20 79 6e 65 77 3c 34 20 54 48 |130 IF ynew<4 TH| 00000410 45 4e 20 75 70 3d 46 41 4c 53 45 0d 0d 5b 49 66 |EN up=FALSE..[If| 00000420 20 62 6f 75 6e 63 65 20 6f 66 66 20 62 6f 74 74 | bounce off bott| 00000430 6f 6d 20 6f 66 20 73 63 72 65 65 6e 2c 20 62 65 |om of screen, be| 00000440 65 70 2c 20 77 61 69 74 20 66 6f 72 20 73 70 61 |ep, wait for spa| 00000450 63 65 2c 20 61 6e 64 20 70 75 74 20 62 61 6c 6c |ce, and put ball| 00000460 20 62 61 63 6b 0d 20 69 6e 20 69 6e 69 74 69 61 | back. in initia| 00000470 6c 20 70 6f 73 69 74 69 6f 6e 5d 0d 0d 20 20 31 |l position].. 1| 00000480 34 30 20 49 46 20 79 6e 65 77 3d 32 34 38 20 54 |40 IF ynew=248 T| 00000490 48 45 4e 20 56 44 55 37 3a 52 45 50 45 41 54 20 |HEN VDU7:REPEAT | 000004a0 55 4e 54 49 4c 20 49 4e 4b 45 59 28 2d 39 39 29 |UNTIL INKEY(-99)| 000004b0 3a 78 6e 65 77 3d 33 37 3a 79 6e 65 77 3d 31 30 |:xnew=37:ynew=10| 000004c0 30 0d 0d 5b 42 6f 75 6e 63 69 6e 67 20 6f 66 66 |0..[Bouncing off| 000004d0 20 6c 65 66 74 2f 72 69 67 68 74 20 6f 66 20 73 | left/right of s| 000004e0 63 72 65 65 6e 3f 5d 0d 0d 20 20 31 35 30 20 49 |creen?].. 150 I| 000004f0 46 20 78 6e 65 77 3d 31 20 54 48 45 4e 20 6c 65 |F xnew=1 THEN le| 00000500 66 74 3d 46 41 4c 53 45 0d 20 20 31 36 30 20 49 |ft=FALSE. 160 I| 00000510 46 20 78 6e 65 77 3d 37 35 20 54 48 45 4e 20 6c |F xnew=75 THEN l| 00000520 65 66 74 3d 54 52 55 45 0d 0d 5b 45 72 61 73 65 |eft=TRUE..[Erase| 00000530 20 6f 6c 64 20 70 69 63 74 75 72 65 20 6f 66 20 | old picture of | 00000540 62 61 6c 6c 5d 0d 0d 20 20 31 37 30 20 3f 63 68 |ball].. 170 ?ch| 00000550 61 72 3d 30 3a 3f 78 63 3d 78 62 61 6c 6c 20 44 |ar=0:?xc=xball D| 00000560 49 56 34 3a 3f 79 63 3d 79 62 61 6c 6c 20 44 49 |IV4:?yc=yball DI| 00000570 56 38 3a 3f 78 6f 66 66 3d 78 62 61 6c 6c 20 41 |V8:?xoff=xball A| 00000580 4e 44 33 3a 3f 79 6f 66 66 3d 79 62 61 6c 6c 0d |ND3:?yoff=yball.| 00000590 20 20 20 20 20 20 41 4e 44 37 3a 43 41 4c 4c 64 | AND7:CALLd| 000005a0 69 73 70 6c 61 79 0d 0d 5b 61 6e 64 20 72 65 70 |isplay..[and rep| 000005b0 6c 61 63 65 20 77 69 74 68 20 6e 65 77 20 70 69 |lace with new pi| 000005c0 63 74 75 72 65 20 6f 66 20 62 61 6c 6c 5d 0d 0d |cture of ball]..| 000005d0 20 20 31 38 30 20 78 62 61 6c 6c 3d 78 6e 65 77 | 180 xball=xnew| 000005e0 3a 79 62 61 6c 6c 3d 79 6e 65 77 0d 20 20 31 39 |:yball=ynew. 19| 000005f0 30 20 3f 63 68 61 72 3d 30 3a 3f 78 63 3d 78 62 |0 ?char=0:?xc=xb| 00000600 61 6c 6c 20 44 49 56 34 3a 3f 79 63 3d 79 62 61 |all DIV4:?yc=yba| 00000610 6c 6c 20 44 49 56 38 3a 3f 78 6f 66 66 3d 78 62 |ll DIV8:?xoff=xb| 00000620 61 6c 6c 20 41 4e 44 33 3a 3f 79 6f 66 66 3d 79 |all AND3:?yoff=y| 00000630 62 61 6c 6c 0d 20 20 20 20 20 20 41 4e 44 37 3a |ball. AND7:| 00000640 43 41 4c 4c 64 69 73 70 6c 61 79 0d 0d 5b 42 6f |CALLdisplay..[Bo| 00000650 75 6e 63 69 6e 67 20 6f 66 66 20 62 61 74 3f 5d |uncing off bat?]| 00000660 0d 0d 20 20 32 30 30 20 49 46 20 79 62 61 6c 6c |.. 200 IF yball| 00000670 3d 32 33 32 20 41 4e 44 20 28 78 62 61 6c 6c 3e |=232 AND (xball>| 00000680 28 78 62 61 74 2d 32 29 2a 34 29 20 41 4e 44 20 |(xbat-2)*4) AND | 00000690 28 78 62 61 6c 6c 3c 28 78 62 61 74 2b 32 29 2a |(xball<(xbat+2)*| 000006a0 34 29 20 54 48 45 4e 0d 20 20 20 20 20 20 75 70 |4) THEN. up| 000006b0 3d 54 52 55 45 0d |=TRUE.| 000006b6