Acorn Computers BBC Micro Model B w/8271 — Acorn BBC Micro Model B w/8271 User Guide Manual PDF (EN)

147 10 VDU 23,240,28,28,8,127,8,20,34,65 20 PRINT CHR$(240); 30 GOTO 20 Note the last two lines, which print him over and over again. How to make him move We have created a character which can be reproduced in any MODE (except MODE 7 ). By printing him and then erasing him at successive positions he can be made to move across the screen in a similar way to the ball. However, since he exists as a character he is treated as text, not graphics. This means that he is made to appear by using PRINT – as above – and the position can be defined by using the TAB statement. Try this:

5 MODE 4 10 VDU 23,240,28,28,8,127,8,20,34,65 20 PRINT TAB(20,10); CHR$(240) The character appears at text position 20,10. This is a 40 character wide MODE so 20,10 is roughly in the middle of the screen. Now try this: 20 FOR X = 1 TO 19 30 PRINT TAB(X,10); CHR$(240) 40 NEXT X This will print the man 19 times across the screen. Now type these additional lines: 40 FOR T = 1 TO 100: NEXT T 50 PRINT TAB(X,10) ; "" 60 NEXT X and he appears to run across the screen. By alternating lines 30 and 50 so that the value in parentheses is (X,X) he can be made to move diagonally across the screen. Note that line 40 acts as a time delay.