More graphics irt.ese two pages show how you can use PLOT and UNPLOT to make NM noving pictures on the screen. Moving pictures are called animated Varapnicsand they are useful (or games programs, or to illustrate (programs which explain, say, the principles of gravity or ballistics and ih ohtpaths 4 The pictures for video and arcade games Vare controlled by a small computer. The £omputer is programmed to play only the "games and the programs are in the "£omputer's own code, not in BASIC. Pic unplot program A general purpose microcomputer programmed in BASIC makes slower, simpler pictures. It cannot handle all the instructons for the screen guickly enough to make really fast moving graphics. This is how the spot moved. ln a moment this spot will be unplotted too. When the spot reaches the edge ofthe screen the program may stop with an error message as the values for X and Y are outside the screen range of the computer. Th short program makes a spot oflight Move across the screen. Remember, the sammands [or PLOT and UNPLOT vary on When the ball reaches the top ofthe screen the amount to be added to Y is 1. ad ball video games use programs lhe one above to move the ball onthe n. There are simple programrulesto subtracted instead. In the same way, when Pthe bali moving when it reachesthe it reaches the right edge, the amount is Me ol the screen. subtracted from X. Line pattern program Thus program plots a line across the screen and when it reaches the sides, sends it back again in another direction. It does not use UNPLOT so the lines leavea pattern on the screen. The picture onthe night shows what happens when you run the program. The program is set by line 100 to plot 10,000 pixels. You can change this figure to make it shorter, or BREAK the program at a pattern you like. 10 REM: SET UP GRAPHICS MODE HERE IF NECESSARY 20 PRINT "HOW MANY PIXELS ACROSS?, Lines 20 to 50 ask for the height and width 30 INPUT H of the screen. The semi-colon puts your 40 PRINT "AND UP?" reply on the same line as (he guestion. 50 INPUT V 60 LET X

H-8 THEN LET S<-S kato op poe raj pi pom z- reverne when come 160 IF Y<8 THEN LET Te-T Eve er z 170 IF Y>V-S THEN LET Ts-T 180 GOSUB 300 ]————————— Sends the computer to the subroutine to plot the line 190 NEXT | 200 STOP 300 REM: PLOT LINE 310 PLOT (X,Y) pore ii Plots the pixel with the current valne (or X and Y. Try changing the numbers in lines 80 and 90 to; say, 8 or 10 (or larger on a computer with high resolution graphics). This makes the computer plot the pixels al intervals. s]