home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1986 February
/
1986-02.d64
/
horizons
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
1KB
|
30 lines
100 rem bouncer v1.0
110 if peek(49152)=76 and a=0 then sys 49155:goto 140
120 if a=0 then a=1:load "sprot.obj",8,1:rem load machine language
130 if a=1 then a=2:load "images",8,1:rem load sprites
140 poke53280,11:poke53281,11
150 print"[147][151] [183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183]"
160 fori=1to21:print" [146][207][207][207][207][207][207][207][207][207][207][207][207][207][207][207][207][207][207][207][207][207][207][207][207][207][207][207][207] ":next
170 print" ":poke53281,12
180 init=49152:off=49155:speed=49158:dir=49159:xp=49160:yp=49161
190 sys off:poke xp,0:poke yp,0:rem make sure ball is not rotating or visible
200 forj=0to24:poke54272+j,0:read x:poke54272+j,x:next:rem init sid for boom
210 data 0,4,0,12,64,10,0
220 data 0,0,0,12,64,12,0
230 data 0,4,0,12,128,12,0
240 data 0,50,245,47
250 for i=0 to 7:poke 2040+i,248+i:next:rem select sprite shapes
260 poke 53271,255:poke 53277,255:rem make ball double-size
280 for i=0 to 7:read c:poke 53287+i,c:next:rem read in sprite colors
290 poke 53269,255:rem enable all sprites
300 data 1,1,2,2,2,2,2,11:rem last number is shadow's color
310 poke dir,1:rem rotate to the right
320 sys 49152:rem it rotates
330 x1=70:y1=66:x2=249:y2=198:x=x1:y=(y2-y1)/2+y1:xd=2:yd=2
340 poke xp,x:poke yp,y:poke dir,1-254*(xd<0):rem update ball on screen
350 x=x+xd:y=y+yd:rem adjust position according to delta x and delta y
360 if x<x1 or x>x2 then xd=-xd:gosub 390:rem bounce-reverse direction and spin
370 if y<y1 or y>y2 then yd=-yd:gosub 390:rem bounce-reverse direction
380 goto 340
390 poke54276,64:poke54290,128:poke54276,65:poke54290,129:return