'by sephiroth.....

'BOUNCY BALL

'HERE IS THE SOURCE CODE FOR BOUNCY BALL.
'IT's A 1 PLAYER ARCADE GAME
'X SPEEDS UP AND SQUARE SLOWS DOWN
'GET THE BALL PAST THE BLOCK FOR POINTS
'THE BLUE AREA AND RED AREAS GET MORE POINTS
'ESPECIALLY THE BLUE
'THE FASTER YOU GO,THE MORE POINTS YOU GET
'IF YOU COLLIDE WITH THE BLOCK IT'S GAME OVER

'CODE..........

gosub initialise
gosub main_loop
exit

label main_loop
 gosub first_prompt
 gosub drawing
return

label first_prompt
 setrgb 1,255,255,255
 text$="PRESS START TO BEGIN"
 text 220,276,text$
 setrgb 1,255,255,255
 text$="MATT PRODUCTIONS PRESENTS"
 text 190,166,text$
 setrgb 1,255,0,0
 text$ = "B U M P E R   B A L L"
 text 220,216,text$
 gosub wait_controller
return

label drawing
 goto yt
return

label wait_controller
 repeat
  c=peek("port1")
 until (and(c,8)>0)
return

label initialise
 open window 640,512
 clear window
 setrgb 0,0,0,0
return

label yt
 sc=0
 x=100
 y=100
 x2=45
 y2=75
 xadj=0
 yadj=0
 y2adj=1
 open window 640,512
 label start
 clear window
 open window 640,512
 setrgb 1,0,150,0
 fill rect 0,0,640,512
 setrgb 1,200,9,9
 fill rect 0,60,10,120
 fill rect 0,340,10,400
 setrgb 1,0,0,200
 fill rect 0,200,10,250
 setrgb 1,28,56,67
 fill rect 10,10,630,502
 setrgb 1,200,0,0
 fill circle 60,485,20
 setrgb 1,0,0,0
 text$=str$(int(speed))
 text 47,492,text$
 setrgb 1,255,255,255
 fill circle 100,485,20
 setrgb 1,0,0,0
 text$=str$(int(score))
 text 87,492,text$
 setrgb 1,r,255,255
 fill circle x,y,20
 setrgb 1,89,56,99
 fill rect x2-15,y2-15,x2+15,y2+15
 p=peek("port1")
 if and(p,32)=32 d=1
 if and(p,128)=128 d=2
 if and(p,16)=16 d=3
 if and(p,64)=64 d=4
 if and(p,16384)=16384 then 
  speed=speed+.1
 end if
 if and(p,32768)=32768 then
  speed=speed-.1
 end if
 if d=1 then
  r=10
  yadj=0
  xadj=1
 end if
 if d=2 then
  r=80
  yadj=0
  xadj=-1
 end if
 if d=3 then
  r=120
  xadj=0
  yadj=-1
 end if
 if d=4 then
  r=255
  xadj=0
  yadj=1
 end if
 if speed<0 speed=0
 if speed>10 speed=10
 if abs(x-x2)<35 and abs(y-y2)<35 end
 if x<30 then
  if y>199 and y<251 then
   x=590
   d=2
   score=score+9+speed
  end if
  if y>59 and y<119 then
   x=590
   d=2
   score=score+4+speed
  end if
  if y>339 and y<399 then
   x=590
   d=2
   score=score+4+speed
  end if
  x=590
  d=2
  score=score+1+speed
 end if
 if x>600 d=2
 if y<30 d=4
 if y>492 d=3
 if y2<30 y2adj=1
 if y2>492 y2adj=-1
 x=x+xadj*speed
 y=y+yadj*speed
 y2=y2+y2adj*speed*2
 setdrawbuf dw
 dw=1-dw
 setdispbuf dw
goto start

