home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 73
/
073.d81
/
bytes
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
2KB
|
101 lines
97 :
98 :rem protect sprite data location
99 :
100 poke52,62:poke56,62:poke53281,0:poke53280,2:print"[147]"
107 :
108 :rem load sprite data into $3val00
109 :
110 sys57812"bytes.spr",8,0:poke780,0:poke781,0:poke782,62:sys65493
117 :
118 :rem set sprite pointers
119 :
120 fori=0to3:poke2040+i,248+i:next
127 :
128 :rem declare variables for sprites
129 :
130 v=53248:r=v+16:p=v+30:q=v+31:i=peek(p):i=peek(q)
147 :
148 :rem set sprite colors
149 :
150 pokev+39,1:pokev+40,2
160 pokev+40,3:pokev+41,4
167 :
168 :rem set multi-color sprite colors
169 :
170 pokev+37,7:pokev+38,9
180 pokev+28,12
187 :
188 :rem position sprites
189 :
190 fori=0to3:pokev+i*2,160:pokev+1+i*2,70+i*30:next
197 :
198 :rem turn on sprites 0, 1, 2 and 3
199 :
200 pokev+21,15
207 :
208 :rem print messages
209 :
210 print"[154] [208]ress [209][154] to quit to [204][207][193][196][211][212][193][210]"
220 poke214,20:print:print"[208]ick a sprite by pressing 0[154], 1[154], 2 [154]or 3[154]."
230 print" "
240 print" [145][145][145]"
247 :
248 :rem choose sprites
249 :
250 geta$:ifa$="q"then570
260 ifa$<"0"ora$>"3"then250
270 u=val(a$):w=2^u
280 x=peek(v+2*u):y=peek(v+1+2*u)
287 :
288 :rem more messages
290 print" [206]ow move it with the [195][210][211][210] [154]keys. "
300 print" [216][154] and [217][154] will toggle expansion. "
310 print" [208]ress [211][208][193][195][197][154] to choose another sprite. "
317 :
318 :rem move loop
319 :
320 geta$
330 ifa$=" "then200:choose another spr
340 ifa$<>"[145]"then370:cursor up
350 y=y-1:ify<50theny=50
360 goto460
370 ifa$<>""then400:cursor down
380 y=y+1:ify>229theny=229
390 goto460
400 ifa$<>""then430:cursor right
410 x=x+1:ifx>320thenx=320
420 goto450
430 ifa$<>"[157]"then500:cursor left
440 x=x-1:ifx<24thenx=24:goto320
447 :
448 :rem move sprites
449 :
450 poker,peek(r)and(255-w)orw*int(x/256):rem set v+16 (r = v+16) for seam
460 pokev+u*2,xand255:pokev+1+u*2,y:rem sprite position
470 ifpeek(p)andwthenpoke53280,1:poke53280,2:rem spr to spr collision
480 ifpeek(q)andwthenpoke53281,1:poke53281,0:rem spr to background collision
490 goto320
497 :
498 :rem x expansion
499 :
500 ifa$<>"x"then530
510 ifpeek(v+29)andwthenpokev+29,peek(v+29)and(255-w):goto320
520 pokev+29,peek(v+29)orw:goto320
527 :
528 :rem y expansion
529 :
530 ifa$<>"y"then560:y expansion
540 ifpeek(v+23)andwthenpokev+23,peek(v+23)and(255-w):goto320
550 pokev+23,peek(v+23)orw:goto320
560 ifa$<>"q"then320:quit
567 :
568 :rem return to loadstar
569 :
570 pokev+21,0
580 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
590 ifer<>63thenend
600 print"[147][144]load"chr$(34)"hello connect"chr$(34)",8"
610 print"run"
620 poke631,13:poke632,13:poke198,2:end
10000 open15,8,15,"s0:bytes":close15:save"bytes",8:end