Animation - AMSTRAD cpc 6128 User Instruction

Integrated computer/disc system
Hide thumbs Also See for cpc 6128:
Table of Contents

Advertisement

140 NEXT
150 TAG
160 FOR y=60 TO 318 STEP 2
170 MOVE 96,y:PRINT CHR$(224);
180 FRAME:FRAME
190 MOVE 96,y:PRINT CHR$(224);
200 NEXT
210 END
220 MOVE 90,y,1
230 DRAWR 20,0,,1
240 DRAWR 0,20
250 DRAWR -20,0
260 DRAWR 0,-20
270 RETURN
run
Animation
It is possible to produce an animation effect by switching the colours assigned to inks.
Although the contents of the screen memory are unchanged, there appears to be
movement. An example ofthis is included in the 'Welcome' program on Side 4 of your
system discs package (type RUN" d; se" to see that demonstration). The simple
palette switching of that example is not enough, however, if the animated patterns
are required fo overlap. The next example uses ORing of inks to write the numbers 1
to 4 onto the screen. (The shape is determined by scanning the character printed at
the bottom left hand corner and reproducing what is found, in big block graphics.)
The numbers are written in turn using inks 1,2,4 and 8 with the OR mode turned on
-in this case with a control character sequence, see line
50.
Lines
1
60 onwards rotate the palette according to a mathematical formula which
results in one block graphics number at a time being displayed. The inks are set by
inspecting each ink in turn and determining ifit includes the binary component that
we are looking for. For example, the number 3 was drawn in ink 4 and therefore to
show the number 3 we must allocate a visible colour to all inks whose number
contains a binary 4. Those inks are:
4(0100),5(0101),6(0110),7(0111),12(1100),13(1101),14(1110),15(1111)
In a practical application the inks which require to be changed at each stage in the
animation would be calculated, and lines
1
80 to 200 would be replaced by a
speedier section ofprogram.
At your leisure ....
Chapter 9 Page 53

Advertisement

Table of Contents
loading

Table of Contents

Save PDF