[Python] Listati
Simone Federici
s.federici a gmail.com
Gio 10 Ott 2013 18:23:09 CEST
10 REM SPRITE EXAMPLE 1...
20 REM THE HOT AIR BALLOON
30 VIC=13*4096:REM THIS IS WHERE THE VIC REGISTERS BEGIN
35 POKEVIC+21,1:REM ENABLE SPRITE 0
36 POKEVIC+33,14:REM SET BACKGROUND COLOR TO LIGHT BLUE
37 POKEVIC+23,1:REM EXPAND SPRITE 0 IN Y
38 POKEVIC+29,1:REM EXPAND SPRITE 0 IN X
40 POKE2040,192:REM SET SPRITE 0'S POINTER
180 POKEVIC+0,100:REM SET SPRITE 0'S X POSITION
190 POKEVIC+l, 100:REM SET SPRITE 0'S Y POSITION
220 POKEVIC+39,1:REM SET SPRITE 0'S COLOR
250 FORY=0T063:REM BYTE COUNTER WITH SPRITE LOOP
300 READA:REM READ IN A BYTE
310 POKE192*64+Y,A:REM STORE THE DATA IN SPRITE AREA
320 NEXTY:REM CLOSE LOOP
330 DX=l:DY=l
340 X=PEEK(VIC):REM LOOK AT SPRITE 0'S X POSITION
350 Y=PEEK(VIC+l):REM LOOK AT SPRITE 0'S Y POSITION
360 IFY=500RY=208THENDY=-DY:REM IF Y IS ON THE EDGE OF THE....
370 REM SCREEN, THEN REVERSE DELTA Y
380 IFX=24AND(PEEK(VIC+16)AND1)=0THENDX=-DX:REM IF SPRITE IS....
390 REM TOUCHING THE LEFT EDGE (X=24 AND THE MSB FOR SPRITE 0 IS 0), REVERSE IT
400 IFX=40AND(PEEK(VIC+16)AND1)=lTHENDX=-DX:REM IF SPRITE IS....
410 REM TOUCHING THE RIGHT EDGE (X=40 AND THE MSB FOR SPRITE 0 IS 1), REVERSE IT
420 IFX=255ANDDX=lTHENX=-1:SIDE=1
430 REM SWITCH TO OTHER SIDE OF THE SCREEN
440 IFX=0ANDDX=-lTHENX=256:SIDE=0
450 REM SWITCH TO OTHER SIDE OF THE SCREEN
460 X=X+DX:REM ADD DELTA X TO X
470 X=XAND255:REM MAKE SURE X IS IN ALLOWED RANGE
480 Y=Y+DY:REM ADD DELTA Y TO Y
485 POKEVIC+16,SIDE
490 POKEVIC,X:REM PUT NEW X VALUE INTO SPRITE 0'S X POSITION
510 POKEVIC+1,Y:REM PUT NEW Y VALUE INTO SPRITE 0'S Y POSITION
530 GOTO340
600 REM ***** SPRITE DATA *****
610 DATA0,127,0,1,255,192,3,255,224,3,231,224
620 DATA7,217,240,7,223,240,7,217,240,3,231,224
630 DATA3,255,224,3,255,224,2,255,160,1,127,64
640 DATAl,62,64,0,156,128,0,156,128,0,73,0,0,73,0
650 DATA0,62,0,0,62,0,0,62,0,0,28,0,0
-------------- parte successiva --------------
Un allegato HTML è stato rimosso...
URL: <http://lists.python.it/pipermail/python/attachments/20131010/40e71073/attachment.html>
Maggiori informazioni sulla lista
Python