require("lualibs.common")
require("skilanderkit")
boardname="menu.map"

function init(newinitpos, hotload)

	load_altpal(1, "grayhack")

	loadsong("music/charts.kdm")
	setmusic(true)
end

curtime = 0


members = {
"Havujako",
"Hiihtokissa",
"Hiekkalatu",
"Michelangelo of Turtles",
"Hemohespiikki",
"Mononen",
"Pitovoide",
"Ruoaetsalainen Luukku",
"Murtomaalurkki",
"Hiekkamato",
"Jorma Ollila",
"Nykaenen",
"Latukoira",
"Alppinisti",
"Pulkkavahti",
"Suksi Puuceen",
"Veritankkaaja",
"Sisaetila",
"Jauhehiihtaejae",
"Juha Mieto",
"Luksisuistaa",
"Pumpulilla",
"Mehtaesuksi",
"Hiihtopiaelikkoe",
"Savupiippu",
 }


function frame()
	curtime = curtime + 1.0

	if ( not dither ) then
		dither = 0.0
	else
		dither = dither + 0.618035512321
		dither = dither - math.floor(dither)
	end


	local dither2 = (dither - 0.5)*0.4+0.5
	cc = 3.0 + math.sin(curtime * 0.03)*2.0
	clearview(6*32+math.floor(cc + dither2))



	drawtext("HIIHTOLIITTO MEMBERSHIP", 0, 30, 0.9, 0, 16.0, 1)
	--drawtext("STATUS", 100, 40, 1.0, 0, 16.0, 1)

for i,v in ipairs(members) do
	local im = i - 1
	scl = 0.48
	if (i == 4) then scl = 0.38 end
	if (i == 8) then scl = 0.42 end
	local shd = math.floor( 6 + math.sin(i * 0.3 + curtime * 0.1) * 5.0 )
	drawtimer(string.upper(v), 30 + 150*(im%2), 50+math.floor(im/2)*8, scl, shd)
end

	local bpal = 0;
	if ( curtime & 15 ) > 8 then bpal = 1 end

	drawtext("ACCORDING TO MY LICENSE, I WANT TO SEE THE FOLLOWING 3 LINES ''SOMEWHERE'' IN THE ARCHIVE:", 0, 165, 0.23, 1, 16.0, bpal)
	drawtext("// ''BUILD ENGINE ET TOOLS'' COPYRIGHT C 1993-1997 KEN SILVERMAN", 0, 170, 0.3, 1, 16.0, bpal)
	drawtext("// KEN SILVERMAN'S OFFICIAL WEB SITE: ''HTTP://WWW.ADVSYS.NET/KEN''", 0, 175, 0.3, 1, 16.0, bpal)
	drawtext("// SEE THE INCLUDED LICENSE FILE ''BUILDLIC.TXT'' FOR LICENSE INFO.", 0, 180, 0.3, 1, 16.0, bpal)


	if (getkeystatus(1) or getkeystatus(0x1c)) and not gotomode then
		gotomode = 0
		gomode = nil
	end

end


