Sprite Definition Mode-The Sprdef Command - Commodore 128 System Manual

Hide thumbs Also See for 128:
Table of Contents

Advertisement

Here's what the program does:
• Line 5 COLORs the screen black.
• Line 10 sets standard high-resolution GRAPHIC mode.
• Line 15 DRAWs a box in the top-left corner of the screen.
• Lines 20 to 32 DRAW the racing car.
• Lines 35 to 44 DRAW the racing lanes and a finish line.
• Line 45 transfers the picture data from the racing car into
a string variable.
• Lines 50 and 55 transfer the contents of the string
variable into sprites 1 and 2.
• Lines 60 and 65 turn on sprites 1 and 2.
• Lines 70 and 80 position the sprites at the top of the
screen.
• Lines 85 and 87 animate the sprites as though the two
cars are racing each other across the finish line.
ln this section, you have learned how to create sprites, using the
built-in C128 graphics statements such as DRAW and BOX. You
learned how to control the sprites, using the Commodore 128
sprite statements. The Commodore 128 has two other ways of
creating sprites. The first is with the built-in SPRite DEFinition
ability, as described in the following paragraphs. The other
method of creating sprites is similar to that used for the
Commodore 64; see the C64 Programmer's Reference Guide for
details on this sprite-creation technique.
Sprite Definition Mode—The SPRDEF Command
The Commodore 128 has a built-in SPRite DEFinition mode
which enables you to create sprites on your Commodore 128.
You may be familiar with the Commodore 64 method of creating
sprites, in which you required to either have an additional sprite
editor, or design a sprite on a piece of graph paper and then
READ in the coded sprite DATA and POKE it into an available
sprite block. With the new Commodore 128 sprite definition
command SPRDEF, you can construct and edit your own sprites
in a special sprite work area.
To enter SPRDEF mode, type:
SPRDEF
6-24

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

128d

Table of Contents