disable escapekey
 
perform checklist for fonts
 
for i=1 to checklist quantity()
	if checklist string$(i)="Showcard Gothic" then set text font "Showcard Gothic" : goto end_font_search
next i
 
for i=1 to checklist quantity()
	if checklist string$(i)="AgateSSK" then set text font "AgateSSK" : goto end_font_search
next i
 
for i=1 to checklist quantity()
	if checklist string$(i)="AverDisplaySSK" then set text font "AverDisplaySSK" : goto end_font_search
next i
 
set text font "Courier"
 
end_font_search:
 
`load sound "wav/bounce.wav",1
`load sound "wav/hollow.wav",2
`load sound "wav/win.wav",3
`load sound "wav/loss.wav",4
`load music "mp3/Prodigy - Out of Space.mp3",1
`set sound volume 1,100
`set sound volume 2,100
`set sound volume 3,100
`set sound volume 4,100
`set sound speed 2,500
dim hi(1)
so=1
mu=1
 
`set gamma 255,255,255
`cls
`load animation "wmv/Mega Media.wmv",1
`place animation 1,5,5,635,475
`play animation 1
`sleep 4000
`delete animation 1
`cls
 
`loop music 1
 
`set gamma 255,255,255
`cls
`load animation "wmv/Bounce.wmv",1
``place animation 1,5,5,635,475
`play animation 1
`sleep 3000
`delete animation 1
`cls
 
gosub Clic2con
 
Re2:
if file exist("hi.sam")=1 then load array "hi.sam",hi(1)
sc=0
e=0
 
x=rnd(420)+220
y=rnd(50)+215
w=rnd(3)+1
 
myx=450
myy=480
myy=myy-1
l=3
 
a=0
s=2
 
as=20
 
dim st(as,2)
for i=1 to as
	st(i,1)=rnd(420)+220
	st(i,2)=rnd(480)
next i
 
`for ga=0 to 255 step 8
`	r=255-ga
`	g=255-ga
`	b=255-ga
`	set gamma r,g,b
`next ga
`cls
 
set text size 100
ink rgb(255,0,0),0
for i=1 to 3
cls
set gamma 0,0,0
center text 320,190,str$(4-i)
for ga=0 to 255 step 8
	r=ga
	g=ga
	b=ga
	set gamma r,g,b
next ga
sleep 500
for ga=0 to 255 step 8
	r=255-ga
	g=255-ga
	b=255-ga
	set gamma r,g,b
next ga
next i
cls
ink rgb(0,255,0),0
center text 320,190,"GO!"
set gamma 0,0,0
for ga=0 to 255 step 15
	r=ga
	g=ga
	b=ga
	set gamma r,g,b
next ga
for ga=0 to 255 step 15
	r=255-ga
	g=255-ga
	b=255-ga
	set gamma r,g,b
next ga
cls
set gamma 255,255,255
 
for i=1 to as
	dot st(i,1),st(i,2)
next i
 
do
 
	cls
 
	if f=1
		ink rgb(255,255,255),0
		for i=1 to as
			st(i,2)=st(i,2)+10
			if st(i,2)>479 then st(i,2)=0
			dot st(i,1),st(i,2)
		next i
	else
		ink rgb(255,255,255),0
		for i=1 to as
			dot st(i,1),st(i,2)
		next i
	endif
 
	if f=1 then a=a+2
	if f=1 then b=b+2
	if b>5998 then b=0 : d=d+1
	if f=1 then c=c+2
	if c>98 then c=0
	ink rgb(255,0,0),0
	set text size 20
	text 0,0,"Time: "+str$(d)+":"+str$(b/100)+":"+str$(c)
	text 0,20,"Level: "+str$(s-1)
	text 0,40,"Score: "+str$(sc)
	text 0,60,"Hi-score: "+str$(hi(1))
	text 0,80,"Lives: "
	set cursor 52,82
	if text font$()="Courier" then set cursor 72,82
	for i=1 to l
	print "-- ";
	next i
	print " "
 
	ink rgb(0,255,0),0
	set text size 25
	text 0,110,"Instuctions:"
	set text size 15
	text 0,140,"Move the two lines"
	text 0,160,"using the arrow keys"
	text 0,180,"and bounce the ball ."
	text 0,200,"After 30 seconds"
	text 0,220,"you will 'Level up'."
	text 0,240,"Each level the ball"
	text 0,260,"will go faster."
	text 0,280,"You have three lives."
	text 0,300,"See if you can get"
	text 0,320,"the highest score."
	text 0,340,"Press 'r' to resart."
	text 0,360,"Press 'p' to pause."
	text 0,380,"Press 'p' again to unpause."
	text 0,400,"Press 'm' to turn music on/off. "
	text 0,420,"Press 's' to turn sounds on/off. "
	text 0,440,"Press the escape key to quit"
	if f=0
		text 0,460,"Press space..."
	endif
	if f=0 and spacekey()=1 then f=1
 
	if inkey$()="r" then gosub Re
	h=h-1
	if inkey$()="s" and h<0 and so=1 then so=0 : h=25
	if inkey$()="s" and h<0 and so=0 then so=1 : h=25
	k=k-1
	if inkey$()="m" and k<0 and mu=1 then mu=0 : k=25 : rem pause music 1
	if inkey$()="m" and k<0 and mu=0 then mu=1 : k=25 : rem resume music 1
 
	if e>0 then sc=sc+(((s-1)*100)/50) : e=e-(((s-1)*100)/50) : rem if so=1 then play sound 2
 
	`if y<6 and w=1 then w=3 : if s=1 then play sound 1
	`if y<6 and w=4 then w=2 : if s=1 then play sound 1
	if x<226 and w=1 then w=4 : rem if so=1 then play sound 1
	if x<226 and w=3 then w=2 : rem if so=1 then play sound 1
 
	`if x>295 and y>95 and x<350 and y<205 then x=295 
	`if x>350 and y>95 and x<405 and y<205 then x=405 
	`if x>295 and y>95 and x<405 and y<150 then x=295 
	`if x>295 and y>150 and x<405 and y<205 then x=295 
 
	if y>475 and x>myx-35 and x<myx+35 and w=3 
		w=1
		e=e+(s-1)*100
		`if so=1 then play sound 1
	else
		if y>475 and x>myx-35 and x<myx+35 and w=2
			w=4
			e=e+(s-1)*100
			`if so=1 then play sound 1
		else
			if y>480
				l=l-1
				`if so=1 then play sound 4
				aa=1
				y=rnd(50)+215
			endif
		endif
	endif
 
	if y<5 and x>myx-35 and x<myx+35 and w=1 
		w=3
		e=e+(s-1)*100
		`if so=1 then rem play sound 1
	else
		if y<5 and x>myx-35 and x<myx+35 and w=4
			w=2
			e=e+(s-1)*100
			`if so=1 then play sound 1
		else
			if y<0
				l=l-1
				`if so=1 then play sound 4
				aa=1
				y=rnd(50)+215
			endif
		endif
	endif
 
	if x>635 and w=4 then w=1 : rem if so=1 then play sound 1
	if x>635 and w=2 then w=3 : rem if so=1 then play sound 1
 
	if w=1 and f=1 then x=x-s : y=y-s
	if w=2 and f=1 then x=x+s : y=y+s
	if w=3 and f=1 then x=x-s : y=y+s
	if w=4 and f=1 then x=x+s : y=y-s
 
	if l<1
		if sc>hi(1)
			hi(1)=sc
			save array "hi.sam",hi(1)
			gosub NewRec
		endif
		recon=2
		gosub Re
	endif
 
	if rightkey()=1 then myx=myx+(s+1)
	if leftkey()=1 then myx=myx-(s+1)
 
	if inkey$()="z" then aa=1
	if inkey$()="\" then end
	if inkey$()="1" then a=2999
 
	if escapekey()=1 then gosub ending
 
	if myx-30<220 then myx=220+30
	if myx+30>640 then myx=640-30
 
	`set cursor x,y : print w
 
	ink rgb(255,0,0),0
	circle x,y,5
	circle x,y,4
	circle x,y,3
	circle x,y,2
	circle x,y,1
	dot x,y
	dot x-4,y-4
	dot x+4,y+4
	dot x-4,y+4
	dot x+4,y-4
	ink rgb(255,255,255),0
	dot x-2,y-2
	ink rgb(255,150,150),0
	dot x-2,y-1
	dot x-2,y-3
	dot x-1,y-2
	dot x-3,y-2
	ink rgb(255,100,100),0
	dot x-1,y-1
	dot x-1,y-3
	dot x-0,y-2
	ink rgb(0,0,255),0
	line myx-30,myy,myx+30,myy
	line myx-30,0,myx+30,0
	line 220,0,220,480
	line 0,105,220,105
	`box 300,100,400,200
	g=g-1
 
	if aa=1
		`ink rgb(255,255,255),0
		circle x,y,10
		sleep 1000
		aa=0
	endif
 
	if inkey$()="p" and g<0
		sleep 500
		repeat
 
			if inkey$()="z" then aa=1
			if inkey$()="\" then end
			`if escapekey()=1 then gosub ending
			`if inkey$()="r" then gosub Re
			h=h-1
			if inkey$()="s" and h<0 and so=1 then so=0 : h=25
			if inkey$()="s" and h<0 and so=0 then so=1 : h=25
			k=k-1
			if inkey$()="m" and k<0 and mu=1 then mu=0 : k=25 : rem pause music 1
			if inkey$()="m" and k<0 and mu=0 then mu=1 : k=25 : rem resume music 1
 
		until inkey$()="p"
		g=25
	endif
 
	if a>2998
		s=s+1
		e=e+(s-1)*100
		a=0
		`if so=1 then play sound 3
		ink rgb(255,0,0),0
		set text size 100
		center text 320,200,"Level up!"
		sleep 1000
		aa=1
	endif
 
	sync
 
loop
 
 
Clic2con:
 
	dim stst(as+100,2)
	for i=1 to as+100
		stst(i,1)=rnd(640)
		stst(i,2)=rnd(480)
	next i
 
	stx=rnd(640)
	sty=rnd(480)
	stw=rnd(3)+1
 
	set gamma 255,255,255
 
	while mouseclick()=0
 
		cls
 
		set text size 50
		ink rgb(0,255,0),0
		center text 320,190,"Click to continue..."
 
		ink rgb(255,255,255),0
		for i=1 to as+100
			stst(i,2)=stst(i,2)+10
			if stst(i,2)>479 then stst(i,2)=0
			dot stst(i,1),stst(i,2)
		next i
 
		ink rgb(255,0,0),0
		circle stx,sty,5
		circle stx,sty,4
		circle stx,sty,3
		circle stx,sty,2
		circle stx,sty,1
		dot stx,sty
		dot stx-4,sty-4
		dot stx+4,sty+4
		dot stx-4,sty+4
		dot stx+4,sty-4
		ink rgb(255,255,255),0
		dot stx-2,sty-2
		ink rgb(255,150,150),0
		dot stx-2,sty-1
		dot stx-2,sty-3
		dot stx-1,sty-2
		dot stx-3,sty-2
		ink rgb(255,100,100),0
		dot stx-1,sty-1
		dot stx-1,sty-3
		dot stx-0,sty-2
 
		if stx>635 and stw=4 then stw=1 : rem play sound 1
		if stx>635 and stw=2 then stw=3 : rem play sound 1
		if stx<5 and stw=1 then stw=4 : rem play sound 1
		if stx<5 and stw=3 then stw=2 : rem play sound 1
 
		if sty>475 and stw=3 then stw=1 : rem play sound 1
		if sty>475 and stw=2 then stw=4 : rem play sound 1
		if sty<5 and stw=1 then stw=3 : rem play sound 1
		if sty<5 and stw=4 then stw=2 : rem play sound 1
 
		if stw=1 then stx=stx-5 : sty=sty-5
		if stw=2 then stx=stx+5 : sty=sty+5
		if stw=3 then stx=stx-5 : sty=sty+5
		if stw=4 then stx=stx+5 : sty=sty-5
 
		sync
 
	endwhile
 
return
 
Re:
 
	cls
 
	ink rgb(0,0,255),0
	box 150,150,477,347
	ink rgb(0,0,0),0
	box 151,151,476,346
	ink rgb(0,0,255),0
	line 150,200,477,200
 
	box 170,290,290,330
	box 330,290,450,330
	ink rgb(0,0,0),0
	box 171,291,289,329
	box 331,291,449,329
 
	ink rgb(0,255,0),0
	`set text font "Showcard Gothic"
	set text size 40
	text 155,155,"Restart?"
 
	ink rgb(255,0,0),0
	set text size 30
	text 160,210,"Do you want to" 
	text 160,240,"restart?"
 
	set text size 30
	center text 230,295,"yes"
	center text 390,295,"no"
 
	show mouse
 
	do
 
		if mouseclick()=1 and mousex()>170 and mousey()>290 and mousex()<290 and mousey()<330 then goto Re2 : hide mouse
		if mouseclick()=1 and mousex()>330 and mousey()>290 and mousex()<450 and mousey()<330
			if recon=2
				end
			else
				hide mouse
				return
			endif
		endif
 
		sync
 
	loop
 
return
 
ending:
 
	cls
 
	ink rgb(0,0,255),0
	box 150,150,477,347
	ink rgb(0,0,0),0
	box 151,151,476,346
	ink rgb(0,0,255),0
	line 150,200,477,200
 
	box 170,290,290,330
	box 330,290,450,330
	ink rgb(0,0,0),0
	box 171,291,289,329
	box 331,291,449,329
 
	ink rgb(0,255,0),0
	`set text font "Showcard Gothic"
	set text size 40
	text 155,155,"Quit?"
 
	ink rgb(255,0,0),0
	set text size 30
	text 160,210,"Are you sure you" 
	text 160,240,"want to quit?"
 
	set text size 30
	center text 230,295,"yes"
	center text 390,295,"no"
 
	show mouse
 
	do
 
		if mouseclick()=1 and mousex()>170 and mousey()>290 and mousex()<290 and mousey()<330 then end : hide mouse
		if mouseclick()=1 and mousex()>330 and mousey()>290 and mousex()<450 and mousey()<330 then return : hide mouse
 
		sync
 
	loop
 
return
 
NewRec:
 
	cls
 
	ink rgb(0,0,255),0
	box 150,150,477,347
	ink rgb(0,0,0),0
	box 151,151,476,346
	ink rgb(0,0,255),0
	line 150,200,477,200
 
	box 170,290,290,330
	box 330,290,450,330
	ink rgb(0,0,0),0
	box 171,291,289,329
	box 331,291,449,329
 
	ink rgb(0,255,0),0
	`set text font "Showcard Gothic"
	set text size 40
	text 155,155,"Quit?"
 
	ink rgb(255,0,0),0
	set text size 30
	text 160,210,"Congratulations!" 
	text 160,240,"You set a new record!"
 
	set text size 30
	center text 230,295,"OK"
	center text 390,295,"Quit"
 
	show mouse
 
	do
 
		if mouseclick()=1 and mousex()>170 and mousey()>290 and mousex()<290 and mousey()<330 then return : hide mouse
		if mouseclick()=1 and mousex()>330 and mousey()>290 and mousex()<450 and mousey()<330 then end : hide mouse
 
		sync
 
	loop
 
return