1 rem il mio settimo programma in basic 2 rem sprite commodore 64 3 rem (c) 2021, www.valoroso.it 5 rem incollare qui il programma generato da spritemate 10 print chr$(147) 20 print "generated with spritemate" 30 print "1 of 1 sprites displayed." 40 poke 53285,5: rem multicolor 1 50 poke 53286,13: rem multicolor 2 60 poke 53269,255 : rem set all 8 sprites visible 70 for x=12800 to 12800+63: read y: poke x,y: next x: rem sprite generation 80 :: rem sprite_0 90 poke 53287,7: rem color = 7 100 poke 2040,200: rem pointer 110 poke 53248, 44: rem x pos 120 poke 53249, 120: rem y pos 130 poke 53276, 1: rem multicolor 140 poke 53277, 1: rem width 150 poke 53271, 1: rem height 1000 :: rem sprite_0 / multicolor / color: 7 1010 data 0,40,0,0,40,0,0,40,0,0,40,0,0,235,0,0 1020 data 235,0,1,235,64,1,235,64,5,235,80,21,235,84,85,235 1030 data 85,85,235,85,85,235,85,85,235,85,85,170,85,85,170,85 1040 data 85,170,85,0,170,0,0,170,0,0,130,0,0,130,0,135 2000 rem posizione iniziale 2010 x = 150: y = 130 2020 print: print "muovi sprite con joystick in porta 2" 2030 print "oppure con q w, a s, n v, m b" 2040 print "esci con x" 2050 print "(c) 2021 amedeo valoroso" 2060 print "www.valoroso.it" 2070 print 2100 rem posizione sprite 2110 if ox = x and oy = y then goto 2500 2120 if x < 24 then x = 24 2130 if x > 296 then x = 296 2140 if y < 50 then y = 50 2150 if y > 208 then y = 208 2160 if x > 255 then poke 53264, peek(53264) or 1: rem posizione x (high) 2170 if x <= 255 then poke 53264, peek(53264) and 254: rem posizione x (high) 2180 poke 53248, x and 255: rem posizione x (low) 2190 poke 53249, y: rem posizione y 2200 print "x ="; str$(x); ", y ="; str$(y); " "; chr$(145) 2210 ox = x: oy = y 2500 rem ciclo principale e comandi da tastiera 2510 get c$ 2520 if c$ = "q" then y = y - 5: rem avanti 2530 if c$ = "w" then y = y - 1: rem avanti 2540 if c$ = "a" then y = y + 5: rem indietro 2550 if c$ = "s" then y = y + 1: rem indietro 2560 if c$ = "n" then x = x - 5: rem sinistra 2570 if c$ = "v" then x = x - 1: rem sinistra 2580 if c$ = "m" then x = x + 5: rem destra 2590 if c$ = "b" then x = x + 1: rem destra 2600 if c$ = "x" then end 2700 rem comandi da joystick, porta 2 2710 a = peek(56320) or 16 2720 if a = 126 then y = y - 5: rem avanti 2730 if a = 122 then y = y - 3: x = x - 3: rem avanti sinistra 2740 if a = 118 then y = y - 3: x = x + 3: rem avanti destra 2750 if a = 123 then x = x - 5: rem sinistra 2760 if a = 119 then x = x + 5: rem destra 2770 if a = 125 then y = y + 5: rem indietro 2780 if a = 121 then y = y + 3: x = x - 3: rem indietro sinistra 2790 if a = 117 then y = y + 3: x = x + 3: rem indietro destra 2800 goto 2100