ZX Computings - OpenLibra
ZX Computings - OpenLibra
ZX Computings - OpenLibra
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
BASIC PROGRAM<br />
5 LET Z = 1 + PEEK 16396<br />
+ 256 * PEEK 16397<br />
100 POKE Z + 726,128<br />
150 LET AS = INKEY$<br />
160 IF A$<br />
"9" THEN GOTO 10<br />
170 LET A = VAL A$<br />
180 FOR B = 693 TOO STEP<br />
- 33<br />
200 POKE Z + B,23<br />
210 LET B = B + A*0.16<br />
220 NEXT B<br />
320 GOTO 110<br />
(Run using KEYS 0 to 9 to fire)<br />
Now we have the problem of<br />
rubbing out the stars (*) after<br />
each shot. Try:- 300 CLS 320<br />
GOTO 100. This rubs out the<br />
"fire" line backwards, not<br />
such a good idea. Try:- LIST<br />
1 80, EDIT, change line<br />
number to 230, N/L (new<br />
line). LIST 200, EDIT, change<br />
line number to 240 and<br />
change 23 (CHR$ being<br />
poked) to 0, N/L. LIST 210,<br />
EDIT, change line number to<br />
250, N/L. LIST 220, EDIT,<br />
change line number to 260,<br />
N/L. Then add:- 320 GOTO<br />
1 50 AND 300 N/L.<br />
Running the program, now<br />
plots the gun fire, followed<br />
immediately by plotting blank<br />
spaces in the same positions,<br />
using the same routine. This<br />
solution is acceptable though<br />
in my opinion it makes the<br />
whole firing routine too long,<br />
doubling up the time involved<br />
per shot.<br />
It was therefore decided to<br />
try blanking out the fire one<br />
step behind leaving only one<br />
" * " printed at any one time.<br />
Try this:- 230, N/L, 240, N/L,<br />
250, N/L, 260 N/L, (to rub out<br />
the last effort). Add lines:-1 90<br />
POKE (B< 693)*Z + B + 33 -<br />
A*0.16,0 followed by N/L.<br />
Then EDIT, change the line<br />
number to 230 and rub out<br />
(B