Storing The Sprite Data With Sshape - Commodore 128 System Manual

Table of Contents

Advertisement

5 C O L O R 0 , 1 : C O L O R
10 G R A P H I C
1,1
15 B OX
1 , 2 , 2 , 4 5 , 4 5
20 D R A W 1 , 1 7 , 1 0
22 D R A W T O
19,30
24 B OX
1 , 1 1 , 1 0 , 1 5 , 1 8
26 B O X
1 , 3 0 , 1 0 , 3 4 , 1 8
28 B OX
1,11,20,15,.28
30 B O X
1 , 3 0 , 2 0 , 3 4 , 2 8
32 D R A W 1 , 2 6 , 2 8
34 B O X
1 , 2 0 , 1 4 , 2 6 , 1 8 , 9 0 , 1
36 B O X 1 , 1 5 0 , 3 5 , 1 9 5 , 4 0 , 9 0
38 B OX 1 , 1 5 0 , 1 3 5 , 1 9 5 , 1 4 0 , 90, 1
40 B O X 1 , 1 5 0 , 2 1 5 , 1 9 5 , 2 2 0 , 90, 1
42 B O X
1 , 5 0 , 1 8 0 , 3 0 0 , 1 9 5
44 C H A R 1 , 1 8 , 2 3 , " F I N I S H "
RUN the program. You have just drawn a white racing car,
enclosed in a box, in the upper-left corner of the screen. You
have also drawn a raceway with a finish line at the bottom of the
screen. At this point, the racing car is still only a stationary
picture. The car isn't a sprite yet, but you have just completed the
first step in sprite programming - creating the image.

Storing the Sprite Data with SSHAPE

The next step is to save the picture into a text string. Here's the
SSHAPE statement that does it:
45 SSHAPE A$,11,10,34,30:REM SAVE THE PICTURE IN
A STRING
The SSHAPE command stores the screen image (bit pattern) into
a string variable for later processing, according to the specified
screen coordinates.
The numbers 11,10, 34, 30 are the coordinates of the picture.
You must position the coordinates in the correct place or the
SSHAPE statement can't store your picture data correctly into the
string variable A$. If you position the SSHAPE statement on an
empty screen location, the data string is empty. When you later
transfer it into a sprite, you'll realize there is no data present.
4 , l : C O L O R
1, 2
26 , 3 0 : RE M C A R B O D Y
TO 28,10 TO
TO 17,10
TO 19,28
t
1
: RE M SET C O L O R S
: RE M SET H I - R E S
: RE M P I C T U R E FR A M E
: R E M C A R B O D Y
: R E M U P P E R L E FT W H E E L
: RE M U P P E R
RI G H T W H E E L
: R E M L O W E R L EF T W H E E L
: R E M L O W E R RI G H T W H E E L
: RE M D R A W G R I L L E
: RE M C A R
SEAT
: R E M W H I T E
L INES
: RE M W H I T E
L INES
: R E M W H I T E
L I N E S
: R E M F I N I S H O U T L I N E
: R E M D I S P L A Y F I N I S H
G R A P H I C MO D E
6-19

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

128d

Table of Contents