content:retrocomputing:sprite
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
content:retrocomputing:sprite [2023/07/29 22:36] – [Definizione sprite] admin | content:retrocomputing:sprite [2023/08/15 14:54] (current) – [Spostamento e animazione] admin | ||
---|---|---|---|
Line 159: | Line 159: | ||
===== Sprite animation e collision ===== | ===== Sprite animation e collision ===== | ||
- | Il seguente esempio è tratto dal libro //Commodore 64 Graphics and Sound//; è diverso rispetto al listato sopra, perché non ridefinisce gli stessi | + | Il seguente esempio è tratto dal libro //Commodore 64 Graphics and Sound//; è diverso rispetto al listato sopra, perché non ridefinisce gli sprite |
+ | {{: | ||
==== Definizione sprite ==== | ==== Definizione sprite ==== | ||
Line 170: | Line 171: | ||
150 poke2044,15 | 150 poke2044,15 | ||
</ | </ | ||
+ | |||
+ | ==== Spostamento e animazione ==== | ||
Si tratta quindi di 4 sprite ' | Si tratta quindi di 4 sprite ' | ||
Line 182: | Line 185: | ||
</ | </ | ||
- | poi vengono visualizzati | + | 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 | ||
< | < | ||
Line 193: | Line 204: | ||
</ | </ | ||
- | L' | + | L' |
< | < | ||
Line 215: | 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 | ||
+ | 241 print chr$(147) | ||
+ | 242 print" | ||
+ | 243 print" | ||
+ | 244 print " | ||
250 for x=0 to 130 step 8 | 250 for x=0 to 130 step 8 | ||
255 rem move sprites 0 and 2 | 255 rem move sprites 0 and 2 | ||
260 pokevc, | 260 pokevc, | ||
+ | 261 print " | ||
+ | 262 print " | ||
265 rem check for collision | 265 rem check for collision | ||
270 cd=peek(vc+30) | 270 cd=peek(vc+30) | ||
Line 225: | Line 242: | ||
285 rem display sprites 0 and 2 | 285 rem display sprites 0 and 2 | ||
290 pokevc+21,5 | 290 pokevc+21,5 | ||
- | 300 for t=1 to 200:next | + | 300 for t=1 to1000:next |
305 rem move sprites 1 and 3 | 305 rem move sprites 1 and 3 | ||
+ | 306 print " | ||
+ | 307 print " | ||
310 pokevc+2, | 310 pokevc+2, | ||
315 rem check for collision | 315 rem check for collision | ||
Line 233: | Line 252: | ||
335 rem display sprites 1 and 3 | 335 rem display sprites 1 and 3 | ||
340 pokevc+21, | 340 pokevc+21, | ||
- | 350 for t=1 to 200:next | + | 350 for t=1 to1000:next |
360 next x | 360 next x | ||
365 rem display explosion sprite 4 | 365 rem display explosion sprite 4 | ||
Line 239: | Line 258: | ||
380 pokevc+23, | 380 pokevc+23, | ||
390 pokevc+21, | 390 pokevc+21, | ||
+ | 400 for t=1 to 1000:next | ||
+ | 410 pokevc+21, | ||
+ | 420 for t=1 to 500:next | ||
+ | 430 next n | ||
+ | 440 end | ||
400 for t=1 to 1000:next | 400 for t=1 to 1000:next | ||
410 pokevc+21, | 410 pokevc+21, |
content/retrocomputing/sprite.1690663004.txt.gz · Last modified: 2023/07/29 22:36 by admin