EasyManua.ls Logo

Commodore 128D - Page 124

Commodore 128D
427 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...
X
lfX=1,
expands
sprite
in
horizontal
(X)direction
If
X
=
0,
sprite
is
normal
horizontal
size
Y
If
Y
=
1,
expand
sprite
in
vertical
(Y)
direction
If
y
=
0,
sprite
is
normal
vertical
size
M
—If
M
=
1,
sprite
is
multicolor
If
M
=
0,
sprite
is
standard
As
you
can
see,
the
SPRITE
statement
is
powerful,
giving
you
control
over
many
sprite
qualities.
Moving
Sprites
with
MOVSPR
Now
that
your
sprite
is
on
the
screen,
all
you
have
to
do
is
move
it.
The
MOVSPR
statement
controls
the
motion
of
a
sprite
and
allows
you
to
animate
it
on
the
screen.
The
MOVSPR
statement
can
be
used
in
two
ways.
First,
the
MOVSPR
statement
can
place
a
sprite
at
an
absolute
location
on
the
screen,
using
vertical
and
horizontal
coordi
nates.
Add
the
following
statements
to
your
program:
70
MOVSPR
1,240,70:REM
POSITION
SPRITE
1-X
=
240,
Y
=
70
80
MOVSPR
2,120,70:REM
POSITION SPRITE
2—X
=
120,
Y
=
70
Line
70
positions
sprite
1
at
sprite
coordinate
240,70.
Line
80
places
sprite
2
at
sprite
coordinate
120,70.
You
can
also
use
the
MOVSPR
statement
to
move
sprites
relative
to
their
original
positions.
For
example,
place
sprites
1
and
2
at
the
coordinates
as
in
lines
70
and
80.
You
want
to
move
them
from
their
original
locations
to
another
location
on
the
screen.
Use
the
following
statements
to
move
sprites
along
a
specific
route
on
the
screen:
80
MOVSPR,1,180
#
6:REM
MOVE
SPRITE
1
FROM
THE
TOP
TO
THE
BOTTOM
Li
87
MOVSPR
2,180
#
7:REM
MOVE
SPRITE
2
FROM
THE
TOP
TO
THE
BOTTOM
The
first
number
in
this
statement
is
the
sprite
number.
The
second
{—'
number
is
the
direction
expressed
as
the
number
of
degrees
to
move
in
the
clockwise
direction,
relative
to
the
original
position
of
the
sprite.
The
pound
sign
(#)
signifies
that
the
sprite
is
moved
at
the
specified
angle
and
speed
relative
to
a
starting
position,
instead
of
an
absolute
location,
as
in
lines
70
and
80.
The
final
number
speci
fies
the
speed
in
which
the
sprite
moves
along
its
route
on
the
screen,
which
ranges
from
0
through
15.
The
MOVSPR
command
has
two
alternative
forms.
See
Chapter
V,
BASIC
7.0
Encyclopedia
for
these
notations.
116
USING
C128
MODE—Color,
Animation
and
Sprite
Graphics
Statements

Table of Contents

Other manuals for Commodore 128D

Related product manuals