Commodore 64 > Aiuto & Domande

collisioni sprite/sprite

<< < (5/5)

input:
ma io ho modificato il codice come mi hai detto ,   questo e quello che ho provato e funziona,  spartanamente ma funziona ,  ho inserito anche un piccolo sfondo per le collissioni, vedrai che funziona, utilizzo cbm prg studio, ho modificato qualcosa , ho fatto come mi hai consigliato

input:
questo รจ il listato a me funziona , non capisco come mai a te non funziona, avrai copiato parte di codice modificato, ma
5 x=50 : Y=19  : XX=100: YY=80:t=0  :REM Coordinate posizione iniziale sprite 0 e 2
10 poke650,128       :REM ripetizione automatica dei tasti
15 print chr$(147)   :REM cancella lo schescrmo
20 V=53248          :REM inizio registro video
25 POKEV+21,5      :REM abilita lo sprite 0 e 2
30 poke2040,192: poke2042,193:    REM Variabile inizio puntatore forma dal 192  e 193 blocco

31  FOR N =12288 to 12350 :READQ:  POKEN, Q:  NEXT    :REM legge dati sprite 0
32  FOR N =12416 to 12478 :READQ:  POKEN, Q:  NEXT    :REM legge dati sprite 2

34  print chr$(147)



40 POKEV+0,x                :REM coordinate  x  sprite 0
42 POKEV+1,y                :REM coordinate  Y  sprite 0
44 POKEV+4,xx               :REM coordinate  Y  sprite 2
46 POKEV+5,yy               :REM coordinate  Y  sprite 2

48 REM PUNTEGGIO
49  print "{home}{right*30}",t
50 PRINT "                    {cyan}{168}"
51 PRINT "  {168}            {168}    {168}"
52 PRINT "  {168}            {168}    {168}"
53 PRINT "  {168}            {168}    {168}"
54 PRINT "  {168}            {168}    {168}"
55 PRINT "  {168}            {168}    {168}"
56 PRINT "  {168}            {168}    {168}"
57 PRINT "  {168}            {168}    {168}"
58 PRINT "  {168}{168}{168}{168}{168}{168}{168}{168}{168}{168}{168}{168}{168}{168}{168}{168}{168}{168}{168}"





85 c=peek(v+30): REM lettura del rgistro 53278
86 B=peek(v+31): REM lettura del rgistro 53279
87 if B=1 or c=5 then gosub 200

90 REM CONTROLLO MOVIMENTO
91  geta$: ifa$=" " then  91
92  if a$=chr$(157) then x=x-5 :REM SINISTRA
93  if a$=CHR$(29 ) then x=x+5  : rem DESTA               IDEM
94  if a$=chr$(17)  then y=y+5  : REM GIU                 IDEM
95  if a$=CHR$(145) then y=Y-5  :REM SU                  IDEM

100 ifX=>254 then x=254
102 ifX<=24 then x=24
103 if Y=>229 then y=229
104 if Y<=50 then y=50
105  goto 40


200 print "collisione{home}"
250 REM POSIZIONI DELLO SPRITE 0  PRIMA DELLA COLLISIONE
280 if a$=chr$(157) then x=x+5   
285 if a$=chr$(29) then x=x-5
286 if a$=chr$(17) then y=y-5
287 if a$=chr$(145) then y=y+5
 
297 t=t+1
300 return


1115 REM DATI DISEGNO SPRITE
1145 DATA 255,255,255
1175 DATA 255,255,255
1205 DATA 255,255,255
1235 DATA 224,0,7
1265 DATA 224,0,7
1295 DATA 224,0,7
1325 DATA 224,0,7
1355 DATA 224,0,7
1385 DATA 224,0,7
1415 DATA 224,0,7
1445 DATA 224,0,7
1475 DATA 224,0,7
1505 DATA 224,0,7
1535 DATA 224,0,7
1565 DATA 224,0,7
1595 DATA 224,0,7
1625 DATA 224,0,7
1655 DATA 224,0,7
1685 DATA 255,255,255
1715 DATA 255,255,255
1745 DATA 255,255,255
1775 REM
1805 DATA 255,255,255
1835 DATA 255,255,255
1865 DATA 255,255,255
1895 DATA 224,0,7
1925 DATA 224,0,7
1955 DATA 224,0,7
1985 DATA 224,0,7
2015 DATA 224,0,7
2045 DATA 224,0,7
2075 DATA 224,0,7
2105 DATA 224,0,7
2135 DATA 224,0,7
2165 DATA 224,0,7
2195 DATA 224,0,7
2225 DATA 224,0,7
2255 DATA 224,0,7
2285 DATA 224,0,7
2315 DATA 224,0,7
2345 DATA 255,255,255
2375 DATA 255,255,255
2405 DATA 255,255,255

Navigazione

[0] Indice dei post

[*] Pagina precedente

Vai alla versione completa