EasyManua.ls Logo

Commodore Plus 4 - Page 227

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...
Graphics
Programming
in
BASIC
215
250
Restore
SHIFT
keys.
260
End
of
program
execution.
270
Put
two
space
characters
in
the
position
of
the
previous
frame
for
the
rightmost
butterfly
(saved
in
Yl).
280
Set
color
to
multicolor
blue
and
put
up
the
current
frame
for
the
rightmost
butterfly.
290
Put
two
space
characters
in
the
position
of
the
previous
frame
for
the
leftmost
butterfly.
300
Set
color
to
multicolor
green
and
put
up
the
current
frame
for
the
leftmost
butterfly.
310
Save
the
current
position
in
Yl.
Change
Y
to plot
the
butterflies
one
character
line
higher
on
the
next
frame.
But
if
they
fly
off
the
screen,
restart
them
at
the
bottom.
320
End
of
subroutine.
330-380
Data
for
the
three
frames
of
the
butterfly.
Animation
in
Multicolor
Graphics
When
using
a
bit-mapped
screen
for
ani
mation,
you
can
actually
have
the
moving
objects
appear
to
move
in
front
of
a
stationary
background.
Usually
this
is
done
in
machine
language
because
consid
erable
speed
is
required
to
avoid
flicker.
But,
an
example
program
can
be
done
in
BASIC
using
the
SSHAPE
and
GSHAPE
statements.
The
example
uses
two
frames
of
a
pogo
stick
jumper.
First,
the
background
information
that
will
be
under
the
jumper
is
saved
(SSHAPE).
Then,
he
is
plotted
to
the
screen
(GSHAPE).
To
prepare
for
the
next
frame,
the
jumper
is
erased
(by
replacing
the
background
saved
before),
and
the
process
starts
again.
The
SSHAPE
statement
allows
you
to
save
a
portion
of
the
screen
in
a
string
variable.
Because
a
single
string
can
be
at
most
255
bytes
long,
only a
limited
amount
of
the
screen
can
be
saved
at
one
time.
If
you
try
to
save
too
large
a
portion,
a
STRING
TOO
LONG
ERROR
results.
SSHAPE
saves
only
the
pattern
of
bits
in
the
area,
not
the
color
information.
The
GSHAPE
statement
places
such
a
string
anywhere
on
the
screen.
The
colors
used
are
the
current
colors.
If
they
have
changed
since
the
shape
was
saved,
the
new
ones
are
used.
The
last
parameter
of
GSHAPE
lets
you
decide
how
the
shape
is
to
be
placed
on
the
screen:
0
=
shape
replaces
background
1
=
the
inverted
shape
replaces
background

Other manuals for Commodore Plus 4

Related product manuals