home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1986 February / 1986-02.d64 / horizons (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  1KB  |  30 lines

  1. 100 rem bouncer v1.0
  2. 110 if peek(49152)=76 and a=0 then sys 49155:goto 140
  3. 120 if a=0 then a=1:load "sprot.obj",8,1:rem load machine language
  4. 130 if a=1 then a=2:load "images",8,1:rem load sprites
  5. 140 poke53280,11:poke53281,11
  6. 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]"
  7. 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
  8. 170 print"                                   ":poke53281,12
  9. 180 init=49152:off=49155:speed=49158:dir=49159:xp=49160:yp=49161
  10. 190 sys off:poke xp,0:poke yp,0:rem make sure ball is not rotating or visible
  11. 200 forj=0to24:poke54272+j,0:read x:poke54272+j,x:next:rem init sid for boom
  12. 210 data 0,4,0,12,64,10,0
  13. 220 data 0,0,0,12,64,12,0
  14. 230 data 0,4,0,12,128,12,0
  15. 240 data 0,50,245,47
  16. 250 for i=0 to 7:poke 2040+i,248+i:next:rem select sprite shapes
  17. 260 poke 53271,255:poke 53277,255:rem make ball double-size
  18. 280 for i=0 to 7:read c:poke 53287+i,c:next:rem read in sprite colors
  19. 290 poke 53269,255:rem enable all sprites
  20. 300 data 1,1,2,2,2,2,2,11:rem last number is shadow's color
  21. 310 poke dir,1:rem rotate to the right
  22. 320 sys 49152:rem it rotates
  23. 330 x1=70:y1=66:x2=249:y2=198:x=x1:y=(y2-y1)/2+y1:xd=2:yd=2
  24. 340 poke xp,x:poke yp,y:poke dir,1-254*(xd<0):rem update ball on screen
  25. 350 x=x+xd:y=y+yd:rem adjust position according to delta x and delta y
  26. 360 if x<x1 or x>x2 then xd=-xd:gosub 390:rem bounce-reverse direction and spin
  27. 370 if y<y1 or y>y2 then yd=-yd:gosub 390:rem bounce-reverse direction
  28. 380 goto 340
  29. 390 poke54276,64:poke54290,128:poke54276,65:poke54290,129:return
  30.