home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1985 November / Ahoy_Magazine_85-11_1985_Double_L.d64 / ballbounce.bas (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  929b  |  26 lines

  1. 10 rem **** ballbounce.bas ****
  2. 20 print chr$(147):rem clear screen
  3. 30 ball=81:space=96:rule=99:rem codes to print things on the screen
  4. 40 for l=55616 to 55975:poke l,2:next l:rem make ball red
  5. 50 for l=55976 to 56015:poke l,7:next l:rem make floor yellow
  6. 60 poke 53281,0:poke 53280,6:rem black background, blue border
  7. 70 print chr$(5):rem white text
  8. 80 print:print:print "     follow the bouncing ball . . ."
  9. 90 for l=1704 to 1743:poke l,rule:next l:rem draw floor
  10. 100 psn=1664:ct=1:rem starting position and frame counter
  11. 110 for inc=1 to 8:gosub 210:rem this loop draws the ball going up
  12. 120 psn=psn-40+1:rem the ball goes up
  13. 130 if ct>40 then psn=1344:ct=1:goto 150:rem ball off screen--back to beginning
  14. 140 next inc
  15. 150 for dec=1 to 8:gosub 210:rem this loop draws the ball coming down
  16. 160 psn=psn+41:rem the ball comes down
  17. 170 if ct>40 then 100:rem ball off screen -- loop back
  18. 180 next dec
  19. 190 goto 110:rem done--start again
  20. 200 rem **** print ball on screen ****
  21. 210 poke psn,ball
  22. 220 for l=1 to 50:next l
  23. 230 poke psn,space
  24. 240 ct=ct+1:return
  25. 250 end
  26.