Sprite Creation; Using Sprite Statements In A Program - Commodore 128 System Manual

Hide thumbs Also See for 128:
Table of Contents

Advertisement

lines and dots. You have also learned how to color the screen,
switch graphic modes, paint objects on the screen and scale
them. Now it's time to take the next step in graphics programming
— sprite animation.
If you have worked with the Commodore 64, you already know
something about sprites. For those of you who are not familiar
with the subject, a sprite is a moveable object that you can form
into any shape or image. You can color sprites in up to one of 16
colors. Sprites can even be multicolor. The best part is that you
can move them on the screen. Sprites open the door to computer
animation.
Here is the set of sprite statements you will learn about in this
section:
MOVSPR
SPRDEF
SPRITE
SPRSAV
SSHAPE

Sprite Creation

The first step in programming sprites is designing the way the
sprite looks. For example, suppose you want to design a rocket
ship or a racing car sprite. Before you can color or move the
sprite, you must first design the image, ln C128 mode, you can
create sprites in these three ways.
1. Using the SPRITE statement within a program
2. Using SPRite DEFinition mode (SPRDEF)
3. Using the same method as the Commodore 64

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
6-17

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

128d

Table of Contents