home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1985 November
/
Ahoy_Magazine_85-11_1985_Double_L.d64
/
ballbounce.bas
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
929b
|
26 lines
10 rem **** ballbounce.bas ****
20 print chr$(147):rem clear screen
30 ball=81:space=96:rule=99:rem codes to print things on the screen
40 for l=55616 to 55975:poke l,2:next l:rem make ball red
50 for l=55976 to 56015:poke l,7:next l:rem make floor yellow
60 poke 53281,0:poke 53280,6:rem black background, blue border
70 print chr$(5):rem white text
80 print:print:print " follow the bouncing ball . . ."
90 for l=1704 to 1743:poke l,rule:next l:rem draw floor
100 psn=1664:ct=1:rem starting position and frame counter
110 for inc=1 to 8:gosub 210:rem this loop draws the ball going up
120 psn=psn-40+1:rem the ball goes up
130 if ct>40 then psn=1344:ct=1:goto 150:rem ball off screen--back to beginning
140 next inc
150 for dec=1 to 8:gosub 210:rem this loop draws the ball coming down
160 psn=psn+41:rem the ball comes down
170 if ct>40 then 100:rem ball off screen -- loop back
180 next dec
190 goto 110:rem done--start again
200 rem **** print ball on screen ****
210 poke psn,ball
220 for l=1 to 50:next l
230 poke psn,space
240 ct=ct+1:return
250 end