Commodore 64 Manual do Utilizador Página 55

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 83
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 54
PROGRAMMING SPRITES-ANOTHER LOOK
For those of you having trouble with graphics, this section has been
designed as a more elementary tutorial approach to sprites.
MAKING SPRITES IN BASIC-A SHORT PROGRAM
There are at least three different BASIC programming techniques
which let you create graphic images and cartoon animations on the
Commodore 64. You can use the computer's built-in graphics character
set (see Page 376). You can program your own characters (see Page
108) or . . . best of all . . . you can use the computer's built-in "sprite
graphics." To illustrate how easy it is, here's one of the shortest
spritemaking programs you can write in BASIC:
10
20
30
40
5(1
60
70
80
AllDramE
PR ItH "6' -
POKE2iZ14iZ1.. 13
FOF:::;=8:32TO::::32+62 : POKES, 255 : t'~EXT
11,"==5:3248
POKEV+21,l
POKE' +:39.. 1
POKE'v'.'24
POKE + 1 .' 100
This program includes the key "ingredients" you need to create any
sprite. The POKE numbers come from the SPRITEMAKINGCHART on
Page 176. This program defines the first sprite
. . . sprite 0 . . . as a
solid white square on the screen. Here's a line-by-line explanation of the
program:
LINE 10 clears the screen.
LINE 20 sets the "sprite pointer" to where the Commodore 64 will
read its sprite data from. Sprite 0 is set at 2040, sprite 1 at 2041, sprite
2 at 2042, and so on up to sprite 7 at 2047. You can set all 8 sprite
pointers to 13 by using this line in place of line 20:
20 FOR SP=2040T02047:POKE SP,13:NEXT SP
LINE
30 puts the first sprite (sprite 0) into 63 bytes of the Commodore
64's RAM memory starting at location 832 (each sprite requires 63 bytes
of memory). The first sprite (sprite 0) is "addressed" at memory locations
832 to 894.
PROGRAMMINGGRAPHICS 153
Vista de página 54
1 2 ... 50 51 52 53 54 55 56 57 58 59 60 ... 82 83

Comentários a estes Manuais

Sem comentários