149 32 VDU 23,243,28,60,30,60,126,108,162,162 75 IF Y>12 THEN PRINT TAB(X,Y+3);CHR$243; 115 PRINT TAB(X,Y+3); " "; How to make the movement smoother The rocket does not appear to move up the screen smoothly but in a series of jumps. This is because when you use TAB(X,Y) there are only 32 possible lines you can print on. The VDU5 statement (see also chapter 10, where it is used for positioning accents, etc) causes text to be written at the graphics cursor. This means that you can move to any point on the screen on the normal 1280Ч1024 graphics ‘grid’ and print text or user defined characters. To do this MOVE X,Y is used. VDU 4 undoes the effect of the VDU 5 statement.
It causes text to be written where the text cursor is. Then the first character can be printed using PRINT CHR$(240); or VDU 240 . These two alternatives are equivalent but VDU 240 means less typing! We now need to backspace one character to our original position and move down one character cell so we can print the next character. We can’t use TAB(X,Y) because it won’t work after a VDU 5 statement, so we use two of the four ‘cursor movement commands’ (see chapter 10).
VDU 8 Backspace cursor one character VDU 9 Forwardspace cursor one character VDU 10 Move cursor down one line VDU 11 Move cursor up one line Later on we’ll also use VDU 127 which has exactly the same effect as pressing the DELETE key. All the VDU commands are listed at the back of the book – there’s no need to remember them all. We need to use VDU 8 and then VDU 10 , or the other way around. You can string VDU commands together, so we can use VDU 240,8,10 which will print the first character and then move the cursor into position to print the next one. To print the whole rocket and flames this is repeated three times: here it is done in PROCROCKET .
5 MODE 4 7 VDU 23,1,0;0;0;0;:REM turn off cursor 10 VDU 23,240,8,8,28,28,62,62,62,62 20 VDU 23,241,62,62,62,62,62,62,62,62 30 VDU 23,242,62,62,62,127,127,127,93,93