EasyManua.ls Logo

Commodore Plus 4 - Page 224

Commodore Plus 4
464 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
212
Programming
Graphics
Animation
Computer
animation
consists
of
rapidly
displaying
a
series
of
graphics,
each
changed
somewhat
from
the
previous
one,
to
create
the
illusion
of
motion.
There
are
a
number
of
methods
for
doing
this.
The
more
advanced
can
be
accomplished
only
through
direct
control
of
the
graphics
chip.
Also,
to
attain
the
speeds
required
to
fool
the
human
eye,
machine
language
programming
is
usually
necessary.
Only
a
couple
examples
of
straightforward
methods
using
BASIC
are
pre
sented
here.
To
get
more
involved
with
animation,
study
the
concepts
of
directly
controlling
the
chip
from
machine
language
in
the
next
section
and
experiment
with
them.
Animation
Using
Characters
Character
animation
can
be
extremely
convinc
ing,
even
in
BASIC.
The
pattern
on
the
screen
is
defined
by
only
1
byte
(a
screen
code
placed
in
the
proper
character
cell),
or
possibly
2,
when
color
changes
are
occurring.
So
the
pattern
can
be
changed
just
by
changing
the
value
of
that
screen
code.
This
can
be
done
very
quickly.
For
serious
animation,
direct
access
to
the
screen
and
color
memories
(with
POKE
statements)
is
usually
used.
For
information
on
these
memories,
see
the
summary
of
memory
maps
later
in
this
chapter.
This
example
uses
the
CHAR
statement
to
place
multicolor
characters
on
the
screen.
The
animation
consists
of
three
positions
(frames)
of
the
two-character-wide
multicolor
butterfly
presented
earlier.
The
first
(frame
1)
shows
its
wings
wide
open.
The
second
(frame
2)
shows
them
partially
closed.
The
last
(frame
3)
shows
them
totally
closed.
To
animate
the
butterfly,
the
frames
must
be
shown
in
the
sequence
1,2,3,2,1,2,3,2,1,
....
For
the
butterfly
to
appear
to
move,
each
successive
frame
must
be
shown
in
a
different
(adjacent)
pair
of
character
cells
from
the
previous
frame.
So,
we
must
erase
the
previous
frame
in
addition
to
showing
the
next
frame.
Character
Animation
Example
Program
In
this
example,
type
the
small
letters
inside
the
quotes
without
shifting,
and
type
the
capital
letters
inside
the
quotes
shifted.
10
POKE1177,62
20
FORI=0TO727
30
POKE8192+1,PEEK(54272+1)
40
NEXT
50
POKE1177,63
60
POKE65299,(PEEK(65299)AND3)OR32
70
POKE65298,PEEK(65298)AND251
80
POKE65287,PEEK(65287)OR16

Other manuals for Commodore Plus 4

Related product manuals