Startsidan  ▸  Texter  ▸  Teknikblogg

Anders Hesselbom

Programmerare, skeptiker, sekulärhumanist, antirasist.
Författare till bok om C64 och senbliven lantis.
Röstar pirat.

The sprite engine

2010-05-29

One of the built in applications in the C128 is the sprite editor. Enter it by typing SPRDEF. Choose a sprite number, use the cursor keys to move the cursor and numeric keys to draw. 1 will delete a pixel, 2 will draw with the first color. In multicolor mode, you can also use 3 and 4. To save and close the editor, press SHIFT+ENTER followed by ENTER.

The sprite engine in Commodore Basic 7 lets you enable and disable sprites, and control sprite movement. The SPRITE command is used to turn sprites on or off and to set the sprite attributes. The arguments I have used is one-based sprite index (1), on (1), cyan color (4) in front of other graphics (0).

10 SPRITE 1, 1, 4, 0

My next line of code, will tell the sprite to move to the left using the MOVSPR command. The arguments I have used are one-based sprite index (1), 90 degrees at a speed of 4.

20 MOVSPR 1, 90 # 4

Type RUN to start the show.

Categories: Geeky

Tags: C128

Leave a Reply

Your email address will not be published. Required fields are marked *



En kopp kaffe!

Bjud mig på en kopp kaffe (20:-) som tack för bra innehåll!

Bjud på en kopp kaffe!

Om...

Kontaktuppgifter, med mera, finns här.

Följ mig

Twitter Instagram
GitHub RSS

Public Service

Folkbildning om public service.

Hem   |   linktr.ee/hesselbom   |   winsoft.se   |   80tal.se   |   Filmtips