EasyManua.ls Logo

Commodore 128D - Page 121

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...
Using
Sprite
Statements
in
a
Program
This
method
uses
built-in
statements
so
you
don't
have
to
use any
aids
outside
your
program
to
design your
sprite,
as
the
other
two
methods
require.
This
method
uses
some
of
the
graphics
statements
you
learned
in
the
previous
section.
Here's
the
general
procedure.
The
details
will
be
added
as
you
progress.
1.
Draw
a
picture
with
the
graphics
statements
you
learned
in
the
last
section,
such
as
DRAW,
CIRCLE,
BOX
and
PAINT.
Make
the
dimensions
of
the
picture
24
pixels
wide
by
21
pix
els
tall
in
standard
bit
map mode
or
12
pixels
wide
by
21
tall
in
multicolor
bit
map
mode.
2.
Use
the
SSHAPE
statement
to
store
the
picture
data
into
a
string
variable.
<
3.
Transfer
the
picture
data
from
the
string
variable
into
a
sprite
with
the
SPRSAV
statement.
4.
Turn
on
the
sprite,
color
it,
select
either
standard
or
multi
color
mode
and
expand
it,
all
with
the
SPRITE
statement.
5.
Move
the
sprite
with
the
MOVSPR
statement.
Drawing
the
Sprite
Image
Here
are the
actual
statements
that
perform
the
sprite
operations.
When
you
are
finished
with
this
section,
you
will
have
written
your
first
sprite
program.
You'll
be
able
to
RUN
the
program
as
much
as
you
like,
and
SAVE
it
for
future
reference.
The
first
step
is
to
draw
a
picture
(24
by
21
pixels)
on
the
screen
using
DRAW,
CIRCLE,
BOX
or
PAINT.
This
example
is
performed
in
standard
bit
map
mode,
using
a
black
background.
Here's
the
state
ments
that
set
the
graphic
mode
and
color
the
screen
background
black.
5
COLOR
0,1
:REM
COLOR
BACKGROUND
BLACK
10
GRAPHIC
1,1
:REM
SET
STND
BIT
MAP
MODE
The
following
statements
DRAW
a
picture
of
a
racing
car
in
the
upper-left
corner
of
the
screen.
You
already
learned
these
state
ments
in
the
last
section.
113
USING
C128
MODE—Color,
Animation
and
Sprite
Graphics
Statements

Table of Contents

Other manuals for Commodore 128D

Related product manuals