content:retrocomputing:sprite
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
content:retrocomputing:sprite [2023/07/24 21:06] – [Definizione] admin | content:retrocomputing:sprite [2023/08/15 14:45] – [Sprite animation e collision] admin | ||
---|---|---|---|
Line 159: | Line 159: | ||
===== Sprite animation e collision ===== | ===== Sprite animation e collision ===== | ||
- | Il seguente esempio è tratto dal libro //Commodore 64 Graphics and Sound//; | + | Il seguente esempio è tratto dal libro //Commodore 64 Graphics and Sound//; |
+ | |||
+ | {{: | ||
+ | ==== Definizione sprite ==== | ||
+ | |||
+ | Vengono **definiti i dati di 5 sprite**, usando alcune locazioni di memoria a partire da (13*64=)832. Questa area è in realtà il //cassette buffer//, per cui se si usa il registratore, | ||
+ | |||
+ | < | ||
+ | 130 poke2040, | ||
+ | 140 poke2042, | ||
+ | 150 poke2044, | ||
+ | </ | ||
+ | |||
+ | ==== Spostamento e animazione ==== | ||
+ | |||
+ | Si tratta quindi di 4 sprite ' | ||
+ | |||
+ | < | ||
+ | 255 rem move sprites 0 and 2 | ||
+ | 260 pokevc, | ||
+ | ... | ||
+ | 285 rem display sprites 0 and 2 | ||
+ | 290 pokevc+21, | ||
+ | 300 for t=1 to 200:next | ||
+ | </ | ||
+ | |||
+ | I registri nel VIC-II per le **posizioni X degli sprite 0-3** (vc=53248, vc+2=53250, vc+4=53252 e vc+6=53254): | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Il registro ' | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Poi vengono visualizzati gli sprite 1 e 3 (2041 e 2043) con un' | ||
+ | |||
+ | < | ||
+ | 305 rem move sprites 1 and 3 | ||
+ | 310 pokevc+2, | ||
+ | ... | ||
+ | 335 rem display sprites 1 and 3 | ||
+ | 340 pokevc+21, | ||
+ | 350 for t=1 to 200:next | ||
+ | </ | ||
+ | |||
+ | L' | ||
< | < | ||
Line 181: | Line 226: | ||
210 pokevc+39, | 210 pokevc+39, | ||
220 pokevc+41, | 220 pokevc+41, | ||
- | 230 pokevc+43, | + | 230 pokevc+43, |
240 for n=1 to 10 | 240 for n=1 to 10 | ||
250 for x=0 to 130 step 8 | 250 for x=0 to 130 step 8 |
content/retrocomputing/sprite.txt · Last modified: 2023/08/15 14:54 by admin