// fun and games in pixilang - 15/07/2010 - spiny / torment  - hopefully shown / released at sundown 2010
// missed sundown by miles :D now aiming for Sunrise - September 2011 ...

times = load_pixi("graphics/16x16.gif")
steel = load_pixi ("graphics/steel-font6.gif")
// party version text putter
partyversion = load_pixi ("graphics/partyversion.gif")		// party version

show_help_page = 0
show_tune_info = 0
partytransp = 255
countertrans = 1
plasmahx = 220
plasmahy = 60
start_timer (10)
sprites = 1		// sprites on / off flag
scrolleron = 1 // scroller state

party:



pixi_font (times)
clear (BLACK)


if countertrans < 255 {partytransp - 1}

if countertrans > 255 {partytransp + 1}

if countertrans > 512 {countertrans = 0}

countertrans + 1





// keypress etc
handle_hard_keys ( {space = get_hard_key }, 0,0) // built in key handler

if space = 32 {letusbegin}			// check key 1
pl01 = get_timer( 10 )
p1 = 0
pl01 / 2
y02 = -plasmahy while( y02 < plasmahy ) {
	x02 = -plasmahx while( x02 < plasmahx ) {
		r1 = (pl01/32)+x02+y02
		if r1 < 0 { r = -r }
		rr1 = cos( r1 + x02*2 - pl01/2 )
		gg1 = sin( r1 + y02 - pl01/5 )
		bb1 = cos( r1*2 + x02*2 - pl01/4 )
		scr[ p1 ] = get_color( rr1, gg1, bb1 )
		p1 + 1		
		x02 + 1
	}
	y02 + 1
}
//transp (partytransp)
fbox (-220,-100,440,2,#ffffff)
fbox (-220,97,440,2,#ffffff)
fbox (-220,218,440,2,#ffffff)
fbox (-220,-220,440,2,#ffffff)

pixi (partyversion, cos( get_timer( 0 ) / 4 ) / 2, 160)
//transp (255)
print ("***************************",-216,-96,#ffffff)
print ("* Party Version           *",-216,-80,#ffffff)
print ("* may not be 100pc        *",-216,-64,#ffffff)
print ("* complete ...            *",-216,-48,#ffffff)
print ("* Press space             *",-216,-32,#ffffff)
print ("* to start!               *",-216,-16,#ffffff)
print ("*                         *",-216,0,#ffffff)
print ("***************************",-216,16,#ffffff)
print ("* Space quits demo        *",-216,32,#ffffff)
print ("*  during playback        *",-216,48,#ffffff)
print ("*                         *",-216,64,#ffffff)
print ("***************************",-216,80,#ffffff)
box (-220,-220,438,438,#ffffff)
box (-219,-219,438,438,#ffffff)
frame (0)					// loopy bit
goto party					// loopy bit



// the start
letusbegin:
clear (#000000)
setsize = new_pixi( 440, 440, 1 )
set_screen( setsize )
clear (#000000)
start_timer (7) // scroller bounce
start_timer (8) // part nine plasma/raster
music5


scrolltext = "              HELLO SUNRISE, WELCOME TO THE PARTY VERSION OF A LITTLE PC MUSIC DISK THAT HAS BEEN PUT TOGETHER OVER THE COURSE OF JUST OVER A YEAR. IT IS WRITTEN USING AN INTERPRETER CALLED PIXILANG, SIMPLE ENOUGH FOR ME TO USE IT TO MAKE FUN THINGS. LOTS OF OLD GRAPHICS TO GO WITH THE OLD TUNES, JUST DONE FOR FUN"
// scrolltext = "          CHECK IT OUT, A PC RELEASE FROM TORMENT ! SPINY TYPING HERE, AND I'D LIKE TO WELCOME YOU ALL TO THIS MUSIC DISK... IT WAS WRITTEN USING THE QUITE FUNKY PIXILANG LANGUAGE MADE BY ALEX ZOLOTOV. IT'S A HIGH LEVEL LANGUAGE DESIGNED FOR THICKIES LIKE ME WHO CAN'T GRASP THE CONCEPTS OF 'REAL' CODING, IT HAS ROUTINES BUILT IN TO HANDLE MUSIC REPLAY AND STICKING THINGS ON SCREEN, SO A FEW WEEKS OF PLAYING ABOUT RESULTED IN THIS PROD THAT YOU SEE ON YOUR SCREEN. UNFORTUNATLY THERE IS NO COMPILER SO THATS WHY THE EXE HAS ALL THE GRAPHICS AND TUNES IN THE SAME DIRECTORY."
textlength = get_string_size (scrolltext)	// get length of scroller text
templength = (textlength * 32) + 328		// multiply by 32 pixels per character, then add width of screen
templength2 = templength *2				// double it
loopy = templength - templength2		// sub double from original to make negative value (hack alert)
endscrolltext = "  THANKS FOR WATCHING! THIS WAS RELEASED AT SUNRISE 2011  A FINAL VERSION SHOULD BE AVAILABLE LATER, AND THATS A WRAP"




pixi_font (steel)

// variables

shownewtune = 300
move = 20
fadeup=0
fadedown=255
quit=0
x=260
zm = 0
down = 1
intzoom = 0
rot = 0
nowplaying = 5
fadeout=250
nomoreintro=0
scrlx=340
sprtx=-148
sprty=-150
a=0
d_0 = 3
d1 = 2
d2 = 1
x1 = ( rand & 127 ) - 64
x2 = ( rand & 127 ) - 64
x3 = ( rand & 127 ) - 64
partonecounter=0
quitcounter=0

// pictures
scrollybackground = load_pixi ("graphics/scrollybackground.gif")
scientist = load_pixi ("graphics/scientist.gif")		// background
logo = load_pixi ("graphics/logo.gif")
nowplayinglogo1 = load_pixi ("graphics/nowplaying.gif")	// now playing text
chicken = load_pixi ("graphics/chicken2.gif")		// background
marcus = load_pixi ("graphics/marcus.gif")		// background
tmtlogo1 = load_pixi ("graphics/tmtlogo1.gif")
nowplayinglogo2 = load_pixi ("graphics/nowplaying.gif")	// now playing text
tmtlogo2 = load_pixi ("graphics/tmtlogo1.gif")
face = load_pixi ("graphics/face.gif")
border = load_pixi ("graphics/border.gif")
greets01 = load_pixi ("graphics/greets01.gif")
greets02 = load_pixi ("graphics/greets02.gif")
innercircle = load_pixi ("graphics/innercircle.gif")
initcredits = load_pixi ("graphics/initcredits2.gif")
endpage = load_pixi ("graphics/endpage.gif")
progressbarback2 = load_pixi ("graphics/progressbar_back2.gif")
progressbarbutton2 = load_pixi ("graphics/progressbar_button2.gif")
hobbits = load_pixi ("graphics/hobbits.gif")
scenepoints = load_pixi ("graphics/scenepoints.gif")

// now playing gfx
np1pic = load_pixi ("songnames/01_yuletide_ride.gif")
np1picx = load_pixi ("songnames/01_yuletide_ride2.gif")
t01info = load_pixi ("songnames/01_yuletide_ride_info.gif")

np2pic = load_pixi ("songnames/02_sick.gif")
np2picx = load_pixi ("songnames/02_sick2.gif")
t02info = load_pixi ("songnames/02_sick_info.gif")

np3pic = load_pixi ("songnames/03_industrial_life.gif")
t03info = load_pixi ("songnames/03_industrial_life_info.gif")
np3picx = load_pixi ("songnames/03_industrial_life2.gif")

np4pic = load_pixi ("songnames/04_heavenly_bodies.gif")
t04info = load_pixi ("songnames/04_heavenly_bodies_info.gif")
np4picx = load_pixi ("songnames/04_heavenly_bodies2.gif")

np5pic = load_pixi ("songnames/05_silk_cut.gif")
t05info = load_pixi ("songnames/05_silk_cut_info.gif")
np5picx = load_pixi ("songnames/05_silk_cut2.gif")

np6pic = load_pixi ("songnames/06_station.gif")
t06info = load_pixi ("songnames/06_station_info.gif")
np6picx = load_pixi ("songnames/06_station2.gif")

np7pic = load_pixi ("songnames/07_tantamount.gif")
t07info = load_pixi ("songnames/07_tantamount_info.gif")
np7picx = load_pixi ("songnames/07_tantamount2.gif")

np8pic = load_pixi ("songnames/08_next.gif")
t08info = load_pixi ("songnames/08_next_info.gif")
np8picx = load_pixi ("songnames/08_next2.gif")

np9pic = load_pixi ("songnames/09_fashion.gif")
t09info = load_pixi ("songnames/09_fashion_info.gif")
np9picx = load_pixi ("songnames/09_fashion2.gif")

np10pic = load_pixi ("songnames/10_dawn_of_an_old_era.gif")
t10info = load_pixi ("songnames/10_dawn_of_an_old_era_info.gif")
np10picx = load_pixi ("songnames/10_dawn_of_an_old_era2.gif")

buttons = load_pixi ("graphics/buttons.gif")
buttons01 = load_pixi ("graphics/buttons01.gif")
buttons02 = load_pixi ("graphics/buttons02.gif")
buttons03 = load_pixi ("graphics/buttons03.gif")
buttons04 = load_pixi ("graphics/buttons04.gif")
buttons05 = load_pixi ("graphics/buttons05.gif")
buttons06 = load_pixi ("graphics/buttons06.gif")
buttons07 = load_pixi ("graphics/buttons07.gif")
buttons08 = load_pixi ("graphics/buttons08.gif")
buttons09 = load_pixi ("graphics/buttons09.gif")
buttons10 = load_pixi ("graphics/buttons10.gif")
keys = load_pixi ("graphics/keys.gif")



// sprites	
sprite_r = load_pixi ("graphics/sprite_r.gif")		
pixi_transp (sprite_r,1,BLACK)
sprite_g = load_pixi ("graphics/sprite_g.gif")		
pixi_transp (sprite_g,1,BLACK)
sprite_b = load_pixi ("graphics/sprite_b.gif")		
sprite_b_shadow = load_pixi ("graphics/sprite_b_shadow.gif")		
pixi_transp (sprite_b,1,BLACK)

//disting ish logo
dist1 = load_pixi ("graphics/dist1.gif")
dist2 = load_pixi ("graphics/dist2.gif")
dist3 = load_pixi ("graphics/dist3.gif")
dist4 = load_pixi ("graphics/dist4.gif")
dist5 = load_pixi ("graphics/dist5.gif")
dist6 = load_pixi ("graphics/dist6.gif")

//atari intro
desktop1 = load_pixi ("atari/desktop01.gif")
desktop2 = load_pixi ("atari/desktop02.gif")
desktop3 = load_pixi ("atari/desktop03.gif")
pointer = load_pixi ("atari/pointer.gif")
tvoverlay = load_pixi ("atari/tvoverlay.gif")


// DEMO BEGINS HERE


// tv noise
noisetimer = 0





while (noisetimer < 15)
{
clear( BLACK )
effector (WHITE, 256, 0, -192, -135, 384, 270, 1)
pixi (tvoverlay,0,0)
frame( 100 )
noisetimer = noisetimer + 1
}
noisetimer = 0
while (noisetimer < 5)
{
clear( BLACK )
fbox(-192,-135,384,270,#FFFFFF)
pixi (tvoverlay,0,0)
frame( 100 )
noisetimer = noisetimer + 1
}


//atari intro
clear(#000000)
pointerx=30
pointery=12
frame1:
while (pointerx > 20)
{

	pixi (desktop1,0,0)
	pixi (tvoverlay,0,0)
	pixi (pointer,pointerx,pointery)
	pointerx-1
	frame (10)
}
pointery-2
while (pointerx > 10)
{

	pixi (desktop1,0,0)
	pixi (tvoverlay,0,0)
	pixi (pointer,pointerx,pointery)
	pointerx-1
	frame (10)
}
pointery-2
while (pointerx > 0)
{

	pixi (desktop1,0,0)
	pixi (tvoverlay,0,0)
	pixi (pointer,pointerx,pointery)
	pointerx-1
	frame (10)
}
pointery-2
while (pointerx > -10)
{

	pixi (desktop1,0,0)
	pixi (tvoverlay,0,0)
	pixi (pointer,pointerx,pointery)
	pointerx-1
	frame (10)
}
pointery-2
while (pointerx > -20)
{

	pixi (desktop1,0,0)
	pixi (tvoverlay,0,0)
	pixi (pointer,pointerx,pointery)
	pointerx-1
	frame (10)
}
pointery-2
while (pointerx > -30)
{
	pixi (desktop1,0,0)
	pixi (tvoverlay,0,0)
	pixi (pointer,pointerx,pointery)
	pointerx-1
	frame (10)
}
pointery-2
frame2:

pixi (desktop2,0,0)
pixi (tvoverlay,0,0)
frame(300)
frame3:
pixi (desktop3,0,0)
pixi (tvoverlay,0,0)
frame(1200)
// end of atari animation



t_reset							// reset transformations, to clear old data
clear( #006dff )					// cls blue
intro = load_pixi ("graphics/intro.gif")				// pic on screen


while (fadeup < 255)
{
	transp(255)
	clear(#000000)
	transp (fadeup)
	pixi(intro,0,0)						// load intro pic
	frame( 5 )
	fadeup + 1
}
fadeup=0
fadedown=255
frame (800)
while (fadedown > 0)
{
	transp(255)
	clear(#000000)
	transp (fadedown)
	pixi(intro,0,0)						// load intro pic
	frame( 5 )
	fadedown - 1
}
fadedown=255
transp(255)


clear( #000000 )					// cls black
intro2 = load_pixi ("graphics/intro2a.gif")			// load second pic


while (fadeup < 255)
{
	transp(255)
	clear(#000000)
	transp (fadeup)
	pixi(intro2,0,0)					// stick it in the middle of the screen
	frame( 5 )
	fadeup + 1
}
fadeup=0


frame (1400)						// wait a second
intro3 = load_pixi ("graphics/intro2b.gif")			// load third pic, which adds 'presents'

while (fadeup < 255)
{
	transp(255)
	clear(#000000)
	pixi(intro2,0,0)					// stick it in the middle of the screen
	transp (fadeup)
	pixi(intro3,0,0)					// middle again
	frame( 5 )
	fadeup + 1
}
fadeup=0



frame (800)
transp (255)
while (zm < 80)
{
	transp (fadeout)
	t_reset	
	t_rotate_z (rot,0,0)
	clear (#000000)
	pixi(intro3,0,0, zm )
	frame (20)
	zm + 1
	rot+8
	fadeout-3
}
t_reset	
zm = 20
rot=0
transp (256)
clear (#000000)




doneforfun = load_pixi ("graphics/doneforfun.gif")
pixi(doneforfun,0,0,2)
fadeup=0

while (fadeup < 254)
{
	clear(#000000)
	transp (fadeup)

	pixi(doneforfun,0,0,2)
	transp (255)
	frame( 5 )
	fadeup + 1
}


transp(255)
fadeup=0



frame (1000)
noother = load_pixi ("graphics/noother.gif")
pixi(noother,0,209,1)
frame (2500)



// MAIN LOOP HERE
start_timer(3)
start_timer(2)
start_timer(0)
remove_pixi(intro)
remove_pixi(intro2)
remove_pixi(intro3)
w = get_window_xsize
h = get_window_ysize
plasmahx = 220
plasmahy = 80
start_timer(10)

init_vars

start:


// bouncy sprite routs one
y1 = ccos( get_timer( 2 ) / 10 ) - ccos( get_timer( 2 ) / 16 ) 
if y1 < 0 { y1 = -y1 }
y1 = 100 - y1
x1 = x1 + d_0
if x1 > 150 { d_0 = -d_0 }
if x1 < -150 { d_0 = -d_0 }

//two
y2 = ccos( get_timer( 2 ) / 12 ) - ccos( get_timer( 2 ) / 16 ) 
if y2 < 0 { y2 = -y2 }
y2 = 100 - y2
x2 = x2 + d1
if x2 > 150 { d1 = -d1 }
if x2 < -150 { d1 = -d1 }

//three
y3 = ccos( get_timer( 2 ) / 16 ) - ccos( get_timer( 2 ) / 10 ) 
if y3 < 0 { y3 = -y3 }
y3 = 100 - y3
x3 = x3 + d2
if x3 > 150 { d2 = -d2 }
if x3 < -150 { d2 = -d2 }
// end
	
	// keypress etc
	handle_hard_keys ( {keypress = get_hard_key }, 0,0)

	// musicical chairs

	if keypress = 49 {music1}			// check key 1
	if keypress = 50 {music2}			// check key 2
	if keypress = 51 {music3}			// check key 3
	if keypress = 52 {music4}			// check key 4
	if keypress = 53 {music5}			// check key 5
	if keypress = 54 {music6}			// check key 5
	if keypress = 55 {music7}			// check key 7
	if keypress = 56 {music8}			// check key 8
	if keypress = 57 {music9}			// check key 9
	if keypress = 48 {music10}			// check key 0
	if keypress = 115 {sprite_state}	// turn sprites on  off
	if keypress = 99 {scroller_state}	// scroller on off
	if keypress = 105 {song_info_pop}	// show mod info
	if keypress = 107 {showkeys}			// show help screen
	if keypress = 32 {quit=1}			// check for space

	
	
	
handle_pen_keys( 
{
	//DOWN:
	check_pen = 1

},
{
	//MOVE:
},
{
	//UP:
}
)

if check_pen 
{
	if gpr( -215, 187, 14, 33 ) { music1  check_pen = 0 }
	if gpr( -201, 187, 17, 33 ) { music2  check_pen = 0 }
	if gpr( -184, 187, 17, 33 ) { music3  check_pen = 0 }
	if gpr( -167, 187, 17, 33 ) { music4  check_pen = 0 }
	if gpr( -150, 187, 17, 33 ) { music5  check_pen = 0 }
	if gpr( -133, 187, 17, 33 ) { music6  check_pen = 0 }
	if gpr( -116, 187, 17, 33 ) { music7  check_pen = 0 }
	if gpr( -99, 187, 17, 33 ) { music8  check_pen = 0 }
	if gpr( -82, 187, 17, 33 ) { music9  check_pen = 0 }
}

	
part1seconds = get_timer(3)
if nomoreintro=1 {go demopart2}
if partonecounter = 380 {start_timer(3)}
if partonecounter = 380 {demopart2}



// ####################### part 1 zoomy logo ###############
part1:

// debug
//goto demopart9

partonecounter+1
clear(#000000)

pixi (scrollybackground,move,sin( get_timer( 7 ) / 2 ) / 8 + 132,2)


transp(50) 
fbox(-220,-200,440,299,#FFFFFF) 	
transp(50) 
fbox(-220,-205,440,289,#FFFFFF) 	
transp(50) 
fbox(-220,-200,440,279,#FFFFFF) 
transp(50) 
fbox(-220,-195,440,269,#FFFFFF) 	
transp(100)
fbox(-220,-190,440,259,#FFFFFF) 	
transp(150) 
fbox(-220,-185,440,249,#FFFFFF) 
transp(200)	
fbox(-220,-180,440,239,#FFFFFF) 
transp(256)



xx1=x1/4

pixi (initcredits, 0 , -60,1)

transp (128)
pixi(border,0,0,1)	// black border pic
transp(255)
frame(20)
move - 2
go skip
 
 
// ################### part 2 marcus face pic##################
demopart2:

if part1seconds > 10000 {go demopart3}
nomoreintro=1

clear(#000000)

while (fadeup < 255)
{
	transp(255)
	clear(#000000)
	transp (fadeup)
	pixi(marcus,0,-19,2)					// background
	transp(255)
	



// graphical progress bar
total = pat*127+pos
pixi ( progressbarback2, 0, -215 )
if total > progress { pixi ( progressbarbutton2 , -198, -215 ) } 
if total > progress*2 { pixi ( progressbarbutton2 , -154, -215 ) } 
if total > progress*3 { pixi ( progressbarbutton2, -110, -215 ) } 
if total > progress*4 { pixi ( progressbarbutton2 , -66, -215 ) } 
if total > progress*5 { pixi ( progressbarbutton2 , -22, -215 ) } 
if total > progress*6 { pixi ( progressbarbutton2 , 22, -215 ) } 
if total > progress*7 { pixi ( progressbarbutton2 , 66, -215 ) } 
if total > progress*8 { pixi ( progressbarbutton2 , 110, -215 ) } 
if total > progress*9 { pixi ( progressbarbutton2 , 154, -215 ) }
fbox (-220,-210,440,2,#000000)
fbox (-220,-220,440,2,#000000)


//scroller
if scrolleron = 0 { goto skipscroller }
pixi_font (steel)			
transp(128)
fbox (-220,sin( get_timer( 7 ) / 4 ) / 16 + 130,440,36,#000000)
transp(255)
print (scrolltext,x,sin( get_timer( 7 ) / 4 ) / 16 + 132,#ffffff)			// prints string 'scrolltext' at 'x'
x-1										// move scroller left by one pixel
if x=loopy {x=260}
skipscroller:
// carryon
	
	
	frame( 7 )
	fadeup + 1
}

pixi(marcus,0,-19,2)					// background



//sprite
if sprites = 0 { goto skipsprites }
else
{
transp(50)
pixi (sprite_b_shadow,x3,y3,1,0)
pixi (sprite_b_shadow,x2,y2,1,0)
pixi (sprite_b_shadow,x1,y1,1,0)
transp(255)
pixi (sprite_r,x1,y1,1,0)
pixi (sprite_g,x2,y2,1,0)
pixi (sprite_b,x3,y3,1,0)
}
skipsprites:
// carry on


showprogress02:
// graphical progress bar
total = pat*127+pos
pixi ( progressbarback2, 0, -215 )
if total > progress { pixi ( progressbarbutton2 , -198, -215 ) } 
if total > progress*2 { pixi ( progressbarbutton2 , -154, -215 ) } 
if total > progress*3 { pixi ( progressbarbutton2, -110, -215 ) } 
if total > progress*4 { pixi ( progressbarbutton2 , -66, -215 ) } 
if total > progress*5 { pixi ( progressbarbutton2 , -22, -215 ) } 
if total > progress*6 { pixi ( progressbarbutton2 , 22, -215 ) } 
if total > progress*7 { pixi ( progressbarbutton2 , 66, -215 ) } 
if total > progress*8 { pixi ( progressbarbutton2 , 110, -215 ) } 
if total > progress*9 { pixi ( progressbarbutton2 , 154, -215 ) }



//scroller
if scrolleron = 0 { goto skipscroller }
pixi_font (steel)			
transp(128)
fbox (-220,sin( get_timer( 7 ) / 4 ) / 16 + 130,440,36,#000000)
transp(255)
print (scrolltext,x,sin( get_timer( 7 ) / 4 ) / 16 + 132,#ffffff)			// prints string 'scrolltext' at 'x'
x-1										// move scroller left by one pixel
if x=loopy {x=260}
skipscroller:
// carryon

if nowplaying = 1 {np1}
if nowplaying = 2 {np2}
if nowplaying = 3 {np3}
if nowplaying = 4 {np4}
if nowplaying = 5 {np5}
if nowplaying = 6 {np6}
if nowplaying = 7 {np7}
if nowplaying = 8 {np8}
if nowplaying = 9 {np9}
if nowplaying = 10 {np10}
draw_borders
frame(7)
go skip

// #################### part 3 face pic##########################
demopart3:
if part1seconds > 20000 {go demopart4}
clear(#000000)
pixi(face,0,-19,2)					// background



//sprite
if sprites = 0 { goto skipsprites }
transp(50)
pixi (sprite_b_shadow,x3,y3,1,0)
pixi (sprite_b_shadow,x2,y2,1,0)
pixi (sprite_b_shadow,x1,y1,1,0)
transp(255)
pixi (sprite_r,x1,y1,1,0)
pixi (sprite_g,x2,y2,1,0)
pixi (sprite_b,x3,y3,1,0)
skipsprites:
// carry on

// graphical progress bar
total = pat*127+pos
pixi ( progressbarback2, 0, -215 )
if total > progress { pixi ( progressbarbutton2 , -198, -215 ) } 
if total > progress*2 { pixi ( progressbarbutton2 , -154, -215 ) } 
if total > progress*3 { pixi ( progressbarbutton2, -110, -215 ) } 
if total > progress*4 { pixi ( progressbarbutton2 , -66, -215 ) } 
if total > progress*5 { pixi ( progressbarbutton2 , -22, -215 ) } 
if total > progress*6 { pixi ( progressbarbutton2 , 22, -215 ) } 
if total > progress*7 { pixi ( progressbarbutton2 , 66, -215 ) } 
if total > progress*8 { pixi ( progressbarbutton2 , 110, -215 ) } 
if total > progress*9 { pixi ( progressbarbutton2 , 154, -215 ) }


//scroller
if scrolleron = 0 { goto skipscroller }
pixi_font (steel)			
transp(128)
fbox (-220,sin( get_timer( 7 ) / 4 ) / 16 + 130,440,36,#000000)
transp(255)
print (scrolltext,x,sin( get_timer( 7 ) / 4 ) / 16 + 132,#ffffff)			// prints string 'scrolltext' at 'x'
x-1										// move scroller left by one pixel
if x=loopy {x=260}
skipscroller:
// carryon

if nowplaying = 1 {np1}
if nowplaying = 2 {np2}
if nowplaying = 3 {np3}
if nowplaying = 4 {np4}
if nowplaying = 5 {np5}
if nowplaying = 6 {np6}
if nowplaying = 7 {np7}
if nowplaying = 8 {np8}
if nowplaying = 9 {np9}
if nowplaying = 10 {np10}
draw_borders
frame(7)
go skip

// #################### part 4 scientist pic##########################
demopart4:
if part1seconds > 25000 {go demopart5}
clear(#000000)
pixi(scientist,0,-19,2)					// background



//sprite
if sprites = 0 { goto skipsprites }
transp(50)
pixi (sprite_b_shadow,x3,y3,1,0)
pixi (sprite_b_shadow,x2,y2,1,0)
pixi (sprite_b_shadow,x1,y1,1,0)
transp(255)
pixi (sprite_r,x1,y1,1,0)
pixi (sprite_g,x2,y2,1,0)
pixi (sprite_b,x3,y3,1,0)
skipsprites:
// carry on

// graphical progress bar
total = pat*127+pos
pixi ( progressbarback2, 0, -215 )
if total > progress { pixi ( progressbarbutton2 , -198, -215 ) } 
if total > progress*2 { pixi ( progressbarbutton2 , -154, -215 ) } 
if total > progress*3 { pixi ( progressbarbutton2, -110, -215 ) } 
if total > progress*4 { pixi ( progressbarbutton2 , -66, -215 ) } 
if total > progress*5 { pixi ( progressbarbutton2 , -22, -215 ) } 
if total > progress*6 { pixi ( progressbarbutton2 , 22, -215 ) } 
if total > progress*7 { pixi ( progressbarbutton2 , 66, -215 ) } 
if total > progress*8 { pixi ( progressbarbutton2 , 110, -215 ) } 
if total > progress*9 { pixi ( progressbarbutton2 , 154, -215 ) }




//scroller
if scrolleron = 0 { goto skipscroller }
pixi_font (steel)			
transp(128)
fbox (-220,sin( get_timer( 7 ) / 4 ) / 16 + 130,440,36,#000000)
transp(255)
print (scrolltext,x,sin( get_timer( 7 ) / 4 ) / 16 + 132,#ffffff)			// prints string 'scrolltext' at 'x'
x-1										// move scroller left by one pixel
if x=loopy {x=260}
skipscroller:
// carryon

if nowplaying = 1 {np1}
if nowplaying = 2 {np2}
if nowplaying = 3 {np3}
if nowplaying = 4 {np4}
if nowplaying = 5 {np5}
if nowplaying = 6 {np6}
if nowplaying = 7 {np7}
if nowplaying = 8 {np8}
if nowplaying = 9 {np9}
if nowplaying = 10 {np10}
draw_borders
frame(7)
go skip

// #################### part 5 chicken pic##########################
demopart5:
if part1seconds > 30000 {go demopart6}
clear(#000000)
pixi(chicken,0,-19,2)					// background



//sprite
if sprites = 0 { goto skipsprites }
transp(50)
pixi (sprite_b_shadow,x3,y3,1,0)
pixi (sprite_b_shadow,x2,y2,1,0)
pixi (sprite_b_shadow,x1,y1,1,0)
transp(255)
pixi (sprite_r,x1,y1,1,0)
pixi (sprite_g,x2,y2,1,0)
pixi (sprite_b,x3,y3,1,0)
skipsprites:
// carry on

// graphical progress bar
total = pat*127+pos
pixi ( progressbarback2, 0, -215 )
if total > progress { pixi ( progressbarbutton2 , -198, -215 ) } 
if total > progress*2 { pixi ( progressbarbutton2 , -154, -215 ) } 
if total > progress*3 { pixi ( progressbarbutton2, -110, -215 ) } 
if total > progress*4 { pixi ( progressbarbutton2 , -66, -215 ) } 
if total > progress*5 { pixi ( progressbarbutton2 , -22, -215 ) } 
if total > progress*6 { pixi ( progressbarbutton2 , 22, -215 ) } 
if total > progress*7 { pixi ( progressbarbutton2 , 66, -215 ) } 
if total > progress*8 { pixi ( progressbarbutton2 , 110, -215 ) } 
if total > progress*9 { pixi ( progressbarbutton2 , 154, -215 ) }


//scroller
if scrolleron = 0 { goto skipscroller }
pixi_font (steel)			
transp(128)
fbox (-220,sin( get_timer( 7 ) / 4 ) / 16 + 130,440,36,#000000)
transp(255)
print (scrolltext,x,sin( get_timer( 7 ) / 4 ) / 16 + 132,#ffffff)			// prints string 'scrolltext' at 'x'
x-1										// move scroller left by one pixel
if x=loopy {x=260}
skipscroller:
// carryon

if nowplaying = 1 {np1}
if nowplaying = 2 {np2}
if nowplaying = 3 {np3}
if nowplaying = 4 {np4}
if nowplaying = 5 {np5}
if nowplaying = 6 {np6}
if nowplaying = 7 {np7}
if nowplaying = 8 {np8}
if nowplaying = 9 {np9}
if nowplaying = 10 {np10}
draw_borders
frame(7)
go skip

// #################### part 6 disting logo########################
demopart6:
if part1seconds > 40000 {go demopart7}
clear(#000000)







a+1
b+2


pixi (dist1,ccos( a + 10 / 2 ) / 5 , -203+ccos( b + 12 / 3 ) / 5,1)
pixi (dist2,ccos( a + 20 / 2 ) / 5 , -196+ccos( b + 12 / 3 ) / 5,1)
pixi (dist3,ccos( a + 30 / 2 ) / 5 , -189+ccos( b + 12 / 3 ) / 5,1)
pixi (dist4,ccos( a + 40 / 2 ) / 5 , -182+ccos( b + 12 / 3 ) / 5,1)
pixi (dist5,ccos( a + 50 / 2 ) / 5 , -175+ccos( b + 12 / 3 ) / 5,1)
pixi (dist6,ccos( a + 60 / 2 ) / 5 , -166+ccos( b + 12 / 3 ) / 5,1)
transp(128)
print ("DIST!", ccos( a + 1 / 2 ) / 5-210 , -220+ccos( b + 12 / 3 ) / 5, #ffffff)
transp(255)
fbox(-180,-130,360,255,#FFFFFF)

if part1seconds < 35000 {pixi (greets01, 0,-3, 1)} else {pixi (greets02, 0,-3, 1)}

box(-178,-128,356,251,#000000) 



//scroller
if scrolleron = 0 { goto skipscroller }
pixi_font (steel)			
transp(128)
fbox (-220,sin( get_timer( 7 ) / 4 ) / 16 + 130,440,36,#000000)
transp(255)
print (scrolltext,x,sin( get_timer( 7 ) / 4 ) / 16 + 132,#ffffff)			// prints string 'scrolltext' at 'x'
x-1										// move scroller left by one pixel
if x=loopy {x=260}
skipscroller:
// carryon

// borders not needed on disty screen
// draw_borders
if nowplaying = 1 {np1}
if nowplaying = 2 {np2}
if nowplaying = 3 {np3}
if nowplaying = 4 {np4}
if nowplaying = 5 {np5}
if nowplaying = 6 {np6}
if nowplaying = 7 {np7}
if nowplaying = 8 {np8}
if nowplaying = 9 {np9}
if nowplaying = 10 {np10}
frame(7)
go skip

// #################### part 7 credits##########################
demopart7:
if part1seconds > 50000 {go demopart8}
clear(#000000)
pixi(innercircle,0,-19,2)					// background




//sprite
if sprites = 0 { goto skipsprites }
transp(50)
pixi (sprite_b_shadow,x3,y3,1,0)
pixi (sprite_b_shadow,x2,y2,1,0)
pixi (sprite_b_shadow,x1,y1,1,0)
transp(255)
pixi (sprite_r,x1,y1,1,0)
pixi (sprite_g,x2,y2,1,0)
pixi (sprite_b,x3,y3,1,0)
skipsprites:
// carry on


// graphical progress bar
total = pat*127+pos
pixi ( progressbarback2, 0, -215 )
if total > progress { pixi ( progressbarbutton2 , -198, -215 ) } 
if total > progress*2 { pixi ( progressbarbutton2 , -154, -215 ) } 
if total > progress*3 { pixi ( progressbarbutton2, -110, -215 ) } 
if total > progress*4 { pixi ( progressbarbutton2 , -66, -215 ) } 
if total > progress*5 { pixi ( progressbarbutton2 , -22, -215 ) } 
if total > progress*6 { pixi ( progressbarbutton2 , 22, -215 ) } 
if total > progress*7 { pixi ( progressbarbutton2 , 66, -215 ) } 
if total > progress*8 { pixi ( progressbarbutton2 , 110, -215 ) } 
if total > progress*9 { pixi ( progressbarbutton2 , 154, -215 ) }



//scroller
if scrolleron = 0 { goto skipscroller }
pixi_font (steel)			
transp(128)
fbox (-220,sin( get_timer( 7 ) / 4 ) / 16 + 130,440,36,#000000)
transp(255)
print (scrolltext,x,sin( get_timer( 7 ) / 4 ) / 16 + 132,#ffffff)			// prints string 'scrolltext' at 'x'
x-1										// move scroller left by one pixel
if x=loopy {x=260}
skipscroller:
// carryon


if nowplaying = 1 {np1}
if nowplaying = 2 {np2}
if nowplaying = 3 {np3}
if nowplaying = 4 {np4}
if nowplaying = 5 {np5}
if nowplaying = 6 {np6}
if nowplaying = 7 {np7}
if nowplaying = 8 {np8}
if nowplaying = 9 {np9}
if nowplaying = 10 {np10}
draw_borders
frame(7)
go skip


//################################# part 8 - rasters ########################################
demopart8:
if part1seconds > 60000 {go demopart9}
clear(#000000)

pixi(hobbits,0,-19,2)					
draw_stripes





// graphical progress bar
total = pat*127+pos
pixi ( progressbarback2, 0, -215 )
if total > progress { pixi ( progressbarbutton2 , -198, -215 ) } 
if total > progress*2 { pixi ( progressbarbutton2 , -154, -215 ) } 
if total > progress*3 { pixi ( progressbarbutton2, -110, -215 ) } 
if total > progress*4 { pixi ( progressbarbutton2 , -66, -215 ) } 
if total > progress*5 { pixi ( progressbarbutton2 , -22, -215 ) } 
if total > progress*6 { pixi ( progressbarbutton2 , 22, -215 ) } 
if total > progress*7 { pixi ( progressbarbutton2 , 66, -215 ) } 
if total > progress*8 { pixi ( progressbarbutton2 , 110, -215 ) } 
if total > progress*9 { pixi ( progressbarbutton2 , 154, -215 ) }



//scroller
if scrolleron = 0 { goto skipscroller }
pixi_font (steel)			
transp(128)
fbox (-220,sin( get_timer( 7 ) / 4 ) / 16 + 130,440,36,#000000)
transp(255)
print (scrolltext,x,sin( get_timer( 7 ) / 4 ) / 16 + 132,#ffffff)			// prints string 'scrolltext' at 'x'
x-1										// move scroller left by one pixel
if x=loopy {x=260}
skipscroller:
// carryon

if nowplaying = 1 {np1}
if nowplaying = 2 {np2}
if nowplaying = 3 {np3}
if nowplaying = 4 {np4}
if nowplaying = 5 {np5}
if nowplaying = 6 {np6}
if nowplaying = 7 {np7}
if nowplaying = 8 {np8}
if nowplaying = 9 {np9}
if nowplaying = 10 {np10}
draw_borders
frame(7)
go skip


// ********************************************** part nine - scene points ! ***********************
demopart9:
clear(#000000)

//show pic as bottom layer
pixi ( scenepoints ,0,sin( get_timer( 7 ) / 2 ) / 8 ,2)

//print ("SPRITE $sprites",-200,0)
//print ("SCROLLER $scrolleron",-200,35)



//sprite
if sprites = 0 { goto skipsprites }
transp(50)
pixi (sprite_b_shadow,x3,y3,1,0)
pixi (sprite_b_shadow,x2,y2,1,0)
pixi (sprite_b_shadow,x1,y1,1,0)
transp(255)
pixi (sprite_r,x1,y1,1,0)
pixi (sprite_g,x2,y2,1,0)
pixi (sprite_b,x3,y3,1,0)
skipsprites:
// carry on


// graphical progress bar
total = pat*127+pos
pixi ( progressbarback2, 0, -215 )
if total > progress { pixi ( progressbarbutton2 , -198, -215 ) } 
if total > progress*2 { pixi ( progressbarbutton2 , -154, -215 ) } 
if total > progress*3 { pixi ( progressbarbutton2, -110, -215 ) } 
if total > progress*4 { pixi ( progressbarbutton2 , -66, -215 ) } 
if total > progress*5 { pixi ( progressbarbutton2 , -22, -215 ) } 
if total > progress*6 { pixi ( progressbarbutton2 , 22, -215 ) } 
if total > progress*7 { pixi ( progressbarbutton2 , 66, -215 ) } 
if total > progress*8 { pixi ( progressbarbutton2 , 110, -215 ) } 
if total > progress*9 { pixi ( progressbarbutton2 , 154, -215 ) }
fbox (-220,-210,440,2,#000000)
fbox (-220,-220,440,2,#000000)


//scroller
if scrolleron = 0 { goto skipscroller }
pixi_font (steel)			
transp(128)
fbox (-220,sin( get_timer( 7 ) / 4 ) / 16 + 130,440,36,#000000)
transp(255)
print (scrolltext,x,sin( get_timer( 7 ) / 4 ) / 16 + 132,#ffffff)			// prints string 'scrolltext' at 'x'
x-1										// move scroller left by one pixel
if x=loopy {x=260}
skipscroller:
// carryon



if nowplaying = 1 {np1}
if nowplaying = 2 {np2}
if nowplaying = 3 {np3}
if nowplaying = 4 {np4}
if nowplaying = 5 {np5}
if nowplaying = 6 {np6}
if nowplaying = 7 {np7}
if nowplaying = 8 {np8}
if nowplaying = 9 {np9}
if nowplaying = 10 {np10}


draw_borders
frame(7)
go skip

// tidy up loop
skip:




if nowplaying = 1 {go track1}
if nowplaying = 2 {go track2}
if nowplaying = 3 {go track3}
if nowplaying = 4 {go track4}
if nowplaying = 5 {go track5}
if nowplaying = 6 {go track6}
if nowplaying = 7 {go track7}
if nowplaying = 8 {go track8}
if nowplaying = 9 {go track9}
if nowplaying = 10 {go track10}

// display info

track1: // 43 patterns
pos = get_music_position (1)
pat = get_music_pattern (1)
sum = pat + pos
if ( sum < 170 )
{
}
else { music2 }
go skip2

track2: // 30 patterns
pos = get_music_position (2)
pat = get_music_pattern (2)
sum = pat + pos
if ( sum < 156 )
{
}
else { music3 }

go skip2

track3: // 31 patterns
pos = get_music_position (3)
pat = get_music_pattern (3)
sum = pat + pos
if ( sum < 158 )
{
}
else { music4 }
go skip2

track4: // 27 patterns
pos = get_music_position (4)
pat = get_music_pattern (4)
sum = pos + pat
if ( sum < 154 )
{
}
else { music5 }
go skip2

track5: 
pos = get_music_position (5)
pat = get_music_pattern (5)
sum = pos + pat
if ( sum < 177 )
{
}
else { music6 }
go skip2

track6: 
pos = get_music_position (6)
pat = get_music_pattern (6)
sum = pos + pat
if ( sum < 151 )
{
}
else { music7 }
go skip2

track7: 
pos = get_music_position (7)
pat = get_music_pattern (7)
sum = pos + pat
if ( sum < 153 )
{
}
else { music8 }
go skip2

track8: 
pos = get_music_position (8)
pat = get_music_pattern (8)
sum = pos + pat
if ( sum < 140 )
{
}
else { music9 }
go skip2

track9:
pos = get_music_position (9)
pat = get_music_pattern (9)
sum = pos + pat
if ( sum < 86 )
{
}
else { music10 }
go skip2

track10: // 31 patterns
pos = get_music_position (10)
pat = get_music_pattern (10)
sum = pos + pat
if ( sum < 146 )
{
}
else { music1 }
go skip2

skip2:

if part1seconds > 65000 {start_timer(3)}
else { next01 }
next01:
if part1seconds > 15000 {start_timer(0)}
else { next02 }
next02:
if quit=1 {goto quitit}



go start
//  END OF MAIN LOOP
//  END OF MAIN LOOP
//  END OF MAIN LOOP





//subroutines

scroller_state:

if scrolleron = 1 { goto turnscrolleroff }
turnscrolleron:
scrolleron = 1
keypress=0								// reset key press value
goto endscrolleron

turnscrolleroff:
scrolleron = 0
keypress=0								// reset key press value
goto endscrolleron
endscrolleron:
ret

sprite_state:
if sprites = 1 { goto turnspritesoff }
turnspriteson:
sprites = 1
keypress=0								// reset key press value
goto endsprites

turnspritesoff:
sprites = 0
keypress=0								// reset key press value
goto endsprites
endsprites:
ret

draw_borders:
// left and right, top and bottom 3 pix border lines
// do last, to tidy screen
fbox (-220,-220,3,440,#000000)
fbox (-220,217,440,3,#000000)
fbox (217,-220,3,440,#000000)
fbox (-220,-210,440,3,#000000)
fbox (-220,-220,440,3,#000000)
ret

plasma:
pl01 = get_timer( 10 )
plasma001 = 0													// screen address variable ?
pl01 / 2
y02 = -plasmahy while( y02 < plasmahy ) {
	x02 = -plasmahx while( x02 < plasmahx ) {
		r1 = (pl01/32)+x02+y02
		if r1 < 0 { r = -r }
		rr1 = cos( r1 + x02 - pl01/2 )
		gg1 = sin( r1 + y02 - pl01/5 )
		bb1 = cos( r1*2 + x02 - pl01/4 )
		scr[ plasma001 ] = get_color( rr1, gg1, bb1 )			// not sure
		plasma001 + 1		
		x02 + 1
	}
	y02 + 1
}
ret



//quit routine
// use timer to show dist for a bit
quitit:
stop_music (1)	
stop_music (2)							// stop other musics
stop_music (3)							// from playing
stop_music (5)
stop_music (6)
stop_music (7)
stop_music (8)
stop_music (9)
stop_music (10)
endx=260
music11
quit1:
t_reset
quitcounter+1
clear (#000000)
a+1
b+2

pixi (endpage,0,0)

//scroller

print (endscrolltext,endx,-150,#000000)			// prints string 'scrolltext' at 'x'
endx-1										// move scroller left by one pixel
	


frame(7)
if quitcounter=4000 {exit(0)} else {goto quit1}
exit (0) // back to desktop, as it were.

zoomin:									// Decrement zoom factor 
if zm = 0 {waitdown + 1} else { zm -1 }	// if zoom is 0, it's zoomed all the way in, so add 1 to wait, otherwise dec zoom
if waitdown = 20 {down = 0 }			// once wait has 'waited' 20 times, change to zoom out
fadeout2+12
ret										// rts

zoomout:
waitdown = 0							// reset wait so that zoomout can run
if zm = 20 {down = 1}					// if zoom is 10 we are zoomed out, so switch to zoom in
zm +1									// else inc zoom
fadeout2-12
ret										// rts



// music swappery
music1:
shownewtune = 600
pos = get_music_position (1)
pat = get_music_pattern (1)
sum = pat + pos
nowplaying = 1
progress = 545
fadeseed=40
stoptunes
load_music ("finalmusic/01-Rhino-Yuletide_Ride.xm",1)
vol = 0
music_volume( vol )
play_music (1)							// play it
keypress=0								// reset key press value
ret										// rts

music2:
shownewtune = 600
nowplaying = 2
progress = 381
fadeseed=30
stoptunes
load_music ("finalmusic/02-Rhino-Sick.xm",2)
vol = 0
music_volume( vol )
play_music (2)
keypress=0
ret

music3:
shownewtune = 600
nowplaying = 3
progress = 393
fadeseed=20
stoptunes
load_music ("finalmusic/03-Rhino-Industrial_Life.xm",3)
vol = 0
music_volume( vol )
play_music (3)
keypress=0
ret

music4:
shownewtune = 600
nowplaying = 4
progress = 342
fadeseed=10
stoptunes
load_music ("finalmusic/04-Rhino-Heavenly_Bodies.xm",4)
vol = 0
music_volume( vol )
play_music (4)
keypress=0
ret

music5:
shownewtune = 600
nowplaying = 5
progress = 635
fadeseed=5
stoptunes
load_music ("finalmusic/05-Rhino-Silk_Cut.xm",5)
vol = 0
music_volume( vol )
play_music (5)
keypress=0
ret

music6:
shownewtune = 600
nowplaying = 6
progress = 311
fadeseed=15
stoptunes
load_music ("finalmusic/06-Rhino-Station.xm",6)
vol = 0
music_volume( vol )
play_music (6)
keypress=0
ret

music7:
shownewtune = 600
nowplaying = 7
progress = 355
fadeseed=25
stoptunes
load_music ("finalmusic/07-Rhino-TantaMounT.xm",7)
vol = 0
music_volume( vol )
play_music (7)
keypress=0
ret

music8:
shownewtune = 600
nowplaying = 8
progress = 165
fadeseed=35
stoptunes
load_music ("finalmusic/08-Rhino-Next.xm",8)
vol = 0
music_volume( vol )
play_music (8)
keypress=0
ret

music9:
shownewtune = 600
nowplaying = 9
progress = 147
fadeseed=45
stoptunes
load_music ("finalmusic/09-Rhino-Fashion.xm",9)
vol = 0
music_volume( vol )
play_music (9)
keypress=0
ret

music10:
shownewtune = 600
nowplaying = 10
progress = 241
fadeseed=55
stoptunes
load_music ("finalmusic/10-Rhino-Dawn_of_an_old_era.xm",10)
vol = 0
music_volume( vol )
play_music (10)
keypress=0
ret

music11:
shownewtune = 600
nowplaying = 11
progress = 241
fadeseed=55
stoptunes
load_music ("finalmusic/11-Rhino-Done_For_Fun_endpart.xm",11)
vol = 0
music_volume( vol )
play_music (11)
keypress=0
ret

// stop music subroutine - tidies things up a bit
stoptunes:
stop_music (1)
stop_music (2)
stop_music (3)
stop_music (4)
stop_music (5)
stop_music (6)
stop_music (7)
stop_music (8)
stop_music (9)
stop_music (10)
ret


// song info popup
song_info_pop:
show_tune_info = 600
keypress=0
ret


// help screen
showkeys:
show_help_page = 600
keypress=0
ret

// now playing pic changer
np1:
fbox(-217,181,433,34,#000000) 


show_tune_info-1
if ( show_tune_info > 1 )
{
transp (230)
pixi(t01info,0,0,2)
transp (255)
}

shownewtune-1
if ( shownewtune > 1 )
{
transp (100)
pixi(np1picx,0,0,2)
transp (255)
}

show_help_page -1
if ( show_help_page > 1  )
{
pixi (keys, 0 , 0 , 1)
}

pixi(buttons01,-138,198,0)
pixi(np1pic,89,198,0)
box(-217,181,433,34,#FFffFF) 
ret

np2:
fbox(-217,181,433,34,#000000) 

show_tune_info-1
if ( show_tune_info > 1 )
{
transp (230)
pixi(t02info,0,0,2)
transp (255)
}

shownewtune-1
if ( shownewtune > 1 )
{
transp (100)
pixi(np2picx,0,0,2)
transp (255)
}

show_help_page -1
if ( show_help_page > 1  )
{
pixi (keys, 0 , 0 , 1)
}

pixi(buttons02,-138,198,0)
pixi(np2pic,89,198,0)

box(-217,181,433,34,#FFffFF) 
ret

np3:
fbox(-217,181,433,34,#000000) 

show_tune_info-1
if ( show_tune_info > 1 )
{
transp (230)
pixi(t03info,0,0,2)
transp (255)
}


shownewtune-1
if ( shownewtune > 1 )
{
transp (100)
pixi(np3picx,0,0,2)
transp (255)
}

show_help_page -1
if ( show_help_page > 1  )
{
pixi (keys, 0 , 0 , 1)
}


pixi (np3pic,89, 198,1)
pixi(buttons03,-138,198,0)
box(-217,181,433,34,#FFffFF) 
ret

np4:
fbox(-217,181,433,34,#000000) 

show_tune_info-1
if ( show_tune_info > 1 )
{
transp (230)
pixi(t04info,0,0,2)
transp (255)
}


shownewtune-1
if ( shownewtune > 1 )
{
transp (100)
pixi(np4picx,0,0,2)
transp (255)
}

show_help_page -1
if ( show_help_page > 1  )
{
pixi (keys, 0 , 0 , 1)
}


pixi (np4pic,89, 198,1)
pixi(buttons04,-138,198,0)
box(-217,181,433,34,#FFffFF) 
ret

np5:
fbox(-217,181,433,34,#000000) 

show_tune_info-1
if ( show_tune_info > 1 )
{
transp (230)
pixi(t05info,0,0,2)
transp (255)
}


shownewtune-1
if ( shownewtune > 1 )
{
transp (100)
pixi(np5picx,0,0,2)
transp (255)
}

show_help_page -1
if ( show_help_page > 1  )
{
pixi (keys, 0 , 0 , 1)
}


pixi(buttons05,-138,198,0)
pixi(np5pic,89,198,0)
box(-217,181,433,34,#FFffFF) 
ret

np6:
fbox(-217,181,433,34,#000000) 

show_tune_info-1
if ( show_tune_info > 1 )
{
transp (230)
pixi(t06info,0,0,2)
transp (255)
}


shownewtune-1
if ( shownewtune > 1 )
{
transp (100)
pixi(np6picx,0,0,2)
transp (255)
}

show_help_page -1
if ( show_help_page > 1  )
{
pixi (keys, 0 , 0 , 1)
}


pixi(buttons06,-138,198,0)
pixi(np6pic,89,198,0)
box(-217,181,433,34,#FFffFF) 
ret

np7:
fbox(-217,181,433,34,#000000) 

show_tune_info-1
if ( show_tune_info > 1 )
{
transp (230)
pixi(t07info,0,0,2)
transp (255)
}


shownewtune-1
if ( shownewtune > 1 )
{
transp (100)
pixi(np7picx,0,0,2)
transp (255)
}

show_help_page -1
if ( show_help_page > 1  )
{
pixi (keys, 0 , 0 , 1)
}


pixi(buttons07,-138,198,0)
pixi(np7pic,89,198,0)
box(-217,181,433,34,#FFffFF) 
ret

np8:
fbox(-217,181,433,34,#000000) 

show_tune_info-1
if ( show_tune_info > 1 )
{
transp (230)
pixi(t08info,0,0,2)
transp (255)
}


shownewtune-1
if ( shownewtune > 1 )
{
transp (100)
pixi(np8picx,0,0,2)
transp (255)
}

show_help_page -1
if ( show_help_page > 1  )
{
pixi (keys, 0 , 0 , 1)
}


pixi(buttons08,-138,198,0)
pixi(np8pic,89,198,0)
box(-217,181,433,34,#FFffFF) 
ret

np9:
fbox(-217,181,433,34,#000000) 

show_tune_info-1
if ( show_tune_info > 1 )
{
transp (230)
pixi(t09info,0,0,2)
transp (255)
}


shownewtune-1
if ( shownewtune > 1 )
{
transp (100)
pixi(np9picx,0,0,2)
transp (255)
}

show_help_page -1
if ( show_help_page > 1  )
{
pixi (keys, 0 , 0 , 1)
}


pixi(buttons09,-138,198,0)
pixi(np9pic,89,198,0)
box(-217,181,433,34,#FFffFF) 
ret

np10:
fbox(-217,181,433,34,#000000) 

show_tune_info-1
if ( show_tune_info > 1 )
{
transp (230)
pixi(t10info,0,0,2)
transp (255)
}


shownewtune-1
if ( shownewtune > 1 )
{
transp (100)
pixi(np10picx,0,0,2)
transp (255)
}

show_help_page -1
if ( show_help_page > 1  )
{
pixi (keys, 0 , 0 , 1)
}


pixi (np10pic,89, 198,1)
pixi(buttons10,-138,198,0)
box(-217,181,433,34,#FFffFF) 
ret


// rasters


    draw_stripes:

      if (alpha > 256)
      {
        alpha = 0
      }

      i = num - 1
      while(i >= 0)
      {
        offset = csin(alpha + deltas[ i ]) * amp / 128
        grad_y1 = -20 + offset
        grad_y2 = 20 + offset

        grad_col1 = colors1[ i ]
        grad_col2 = colors2[ i ]
        double_grad

        i - 1
      }

      alpha + dalpha

    ret

 
    init_vars:

      num = 5
      deltas = new_array(num)
      colors1 = new_array(num)
      colors2 = new_array(num)
      bar_h = h / 8
      dalpha = 1
      alpha = 0
      grad_steps = 10
      amp = h / 2 - bar_h / 2

      i = 0
      while(i < num)
      {
        deltas[ i ] = -bar_h * i / 2
        i + 1
      }

      colors1[ 0 ] = #5F0000
      colors2[ 0 ] = #FF1010
      colors1[ 1 ] = #005F00
      colors2[ 1 ] = #10FF10
      colors1[ 2 ] = #00005F
      colors2[ 2 ] = #1010FF
      colors1[ 3 ] = #5F5F00
      colors2[ 3 ] = #FFFF10
      colors1[ 4 ] = #5F005F
      colors2[ 4 ] = #FF10FF

    ret


    double_grad:

      temp1 = grad_steps

      grad_steps / 2
      grad_y2 = grad_y1 + (grad_y2 - grad_y1) / 2
      vert_grad

      temp2 = grad_y2 - grad_y1
      grad_y1 = grad_y2
      grad_y2 = grad_y1 + temp2
      temp2 = grad_col1
      grad_col1 = grad_col2
      grad_col2 = temp2
      vert_grad

    grad_steps = temp1

    ret


    vert_grad:

      z = 0
      step_h = (grad_y2 - grad_y1) / grad_steps
      step_c = 255 / (grad_steps - 1)
      while(z < grad_steps)
      {
        fbox(-w / 2, grad_y1 + z * step_h, w, step_h, get_blend(grad_col1, grad_col2, z * step_c) )
        z + 1
      }

    ret