AMSTRAD CPC464 User Manual page 42

Cpc464 colour personal computer 64k
Hide thumbs Also See for CPC464:
Table of Contents

Advertisement

Now type in:
Run
To improve the movement of the character across the screen, add the following line:
3 0 c a l l &bd19
This program can be further enhanced to improve the movement by adding some delay loops and by
using a different returning character symbol.
Type in:
list
Now add the following lines to the program:
6 0 f o r n = 1 t o 3 0 0 : n e x t n
6 5 f o r x = 3 9 t o 1 s t e p -1
7 0 l o c a t e x , 2 0
7 5 c a l l & b d 1 9
8 0 p r i n t c h r $ ( 2 5 1 ) ; "
"
8 5 n e x t x
9 0 f o r n = 1 t o 3 0 0 : n e x t n
9 5 g o t o 1 0
r u n
Try this interesting small program. We have added some other commands that will be explained in
later chapters. For now, just type in:
new
1 0 m o d e 1
2 0 l o c a t e 2 1 , 1 4 : p r i n t c h r S ( 2 4 4 )
30 tag
4 0 f o r x = 0 t o 6 2 4 s t e p 2
5 0 m o v e r -16,0
6 0 i f x < 3 0 8 o r x > 3 4 0 x > 3 4 0 t h e n y = 1 9 6 : g o t o 9 0
7 0 i f x < 3 2 4 t h e n y = x-1 0 4 : g o t o 8 5
8 0 y = 5 3 6-x
85 soun d 1 , 0 , 2 0 , 7
9 0 m o v e o x , o y : p r i n t " " ; : o x = x : o y = y
1 0 0 m o v e x , y
1 1 0 i f ( x m o d 4 ) = 0 t h e n p r i n t c h r $ ( 2 5 0 ) ;
e l s e p r i n t c h r S ( 2 5 1 ) ;
1 2 0 f o r n = 1 t o 4 : c a l l & b d 1 9 : n e x t n
1 3 0 n e x t x
1 4 0 t a g o f f
1 5 0 g o t o 2 0
run

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents