--__88888____88888____888___88_88888888_888888_____88888____88
--_88_______88___88___888___88____88____88___88___88___88___88
--88_______88_____88__8888__88____88____88___88__88_____88__88
--88_______88_____88__88_8__88____88____88___88__88_____88__88
--88_______88_____88__88__8_88____88____888888___88_____88__88
--88_______88_____88__88__8888____88____88_88____88_____88__88
--88_______88_____88__88___888____88____88__88___88_____88__88
--_88_______88___88___88___888____88____88___88___88___88___88
--__88888____88888____88____88____88____88___888___88888____888888

font = Font.load("data/font/qwe.ttf")--podgruzka chrifta
font:setPixelSizes(20,20)--zadanie razmera chriftu
fonmenu=Image.load("data/img/fonmenu.jpg")
kn=Image.load("data/img/kn.png")
kn2=Image.load("data/img/kn2.png")
red=Color.new(255,0,0)
file=io.open("data/nastroi/jump.CPP","r")--otkritie storonnego faila
jump=file:read()--kod dlia ego schitivania
file:close()--ostanovka schitivania
file=io.open("data/nastroi/left.CPP","r")--otkritie storonnego faila
left=file:read()--kod dlia ego schitivania
file:close()--ostanovka schitivania
file=io.open("data/nastroi/right.CPP","r")--otkritie storonnego faila
right=file:read()--kod dlia ego schitivania
file:close()--ostanovka schitivania
file=io.open("data/nastroi/fire.CPP","r")--otkritie storonnego faila
fire=file:read()--kod dlia ego schitivania
file:close()--ostanovka schitivania
function open()
file=io.open("data/nastroi/jump.CPP","r")--otkritie storonnego faila
jump=file:read()--kod dlia ego schitivania
file:close()--ostanovka schitivania
file=io.open("data/nastroi/left.CPP","r")--otkritie storonnego faila
left=file:read()--kod dlia ego schitivania
file:close()--ostanovka schitivania
file=io.open("data/nastroi/right.CPP","r")--otkritie storonnego faila
right=file:read()--kod dlia ego schitivania
file:close()--ostanovka schitivania
file=io.open("data/nastroi/fire.CPP","r")--otkritie storonnego faila
fire=file:read()--kod dlia ego schitivania
file:close()--ostanovka schitivania
end
function save()
file=io.open("data/nastroi/jump.CPP","w")--otkritie storonnego faila
file:write(jump)--zapis v fail
file:close()--ostanovka schitivania
file=io.open("data/nastroi/left.CPP","w")--otkritie storonnego faila
file:write(left)--zapis v fail
file:close()--ostanovka schitivania
file=io.open("data/nastroi/right.CPP","w")--otkritie storonnego faila
file:write(right)--zapis v fail
file:close()--ostanovka schitivania
file=io.open("data/nastroi/fire.CPP","w")--otkritie storonnego faila
file:write(fire)--zapis v fail
file:close()--ostanovka schitivania
open()
end
function nill()
fon=nil
gmm=nil
circl=nil
end
qr=1
lod=0
loda=0

while true do
screen:clear()--otchistka ekrana
pad = Controls.read()--podgruzka knopok
screen:blit(0,0,fonmenu)
if pad:down() and oldpad:down()~=pad:down() and lod==0 then
qr=qr+1
end
if pad:up() and oldpad:up()~=pad:up() and lod==0 then
qr=qr-1
end
if qr>5 then
qr=1
end
if qr<1 then
qr=5
end
if qr==1 then
screen:blit(90,10,kn2)
if pad:cross() and oldpad:cross()~=pad:cross() then
nill()
lod=1
end
else
screen:blit(100,20,kn)
end
if qr==2 then
screen:blit(90,60,kn2)
if pad:cross() and oldpad:cross()~=pad:cross() then
nill()
lod=1
end
else
screen:blit(100,70,kn)
end
if qr==3 then
screen:blit(90,110,kn2)
if pad:cross() and oldpad:cross()~=pad:cross() then
nill()
lod=1
end
else
screen:blit(100,120,kn)
end
if qr==4 then
screen:blit(90,160,kn2)
if pad:cross() and oldpad:cross()~=pad:cross() then
nill()
lod=1
end
else
screen:blit(100,170,kn)
end
if qr==5 then
screen:blit(155,210,kn2)
if pad:cross() then
nill()
dofile("data/scripts/setting.cpp")
end
else
screen:blit(165,220,kn)
end
if lod==1 then
if loda<=6 then
loda=loda+1
end
if qr==1 then
if pad:cross() and oldpad:cross()~=pad:cross() and loda>=5 then
jump="cross"
save()
loda=0
lod=0
end
if pad:square() and oldpad:square()~=pad:square() and loda>=5 then
jump="square"
save()
loda=0
lod=0
end
if pad:triangle() and oldpad:triangle()~=pad:triangle() and loda>=5 then
jump="triangle"
save()
loda=0
lod=0
end
if pad:circle() and oldpad:circle()~=pad:circle() and loda>=5 then
jump="circle"
save()
loda=0
lod=0
end
if pad:left() and oldpad:left()~=pad:left() and loda>=5 then
jump="left"
save()
loda=0
lod=0
end
if pad:right() and oldpad:right()~=pad:right() and loda>=5 then
jump="right"
save()
loda=0
lod=0
end
if pad:up() and oldpad:up()~=pad:up() and loda>=5 then
jump="up"
save()
loda=0
lod=0
end
if pad:down() and oldpad:down()~=pad:down() and loda>=5 then
jump="down"
save()
loda=0
lod=0
end
if pad:l() and oldpad:l()~=pad:l() and loda>=5 then
jump="l"
save()
loda=0
lod=0
end
if pad:r() and oldpad:r()~=pad:r() and loda>=5 then
jump="r"
save()
loda=0
lod=0
end
end
if qr==2 then
if pad:cross() and oldpad:cross()~=pad:cross() and loda>=5 then
left="cross"
save()
loda=0
lod=0
end
if pad:square() and oldpad:square()~=pad:square() and loda>=5 then
left="square"
save()
loda=0
lod=0
end
if pad:triangle() and oldpad:triangle()~=pad:triangle() and loda>=5 then
left="triangle"
save()
loda=0
lod=0
end
if pad:circle() and oldpad:circle()~=pad:circle() and loda>=5 then
left="circle"
save()
loda=0
lod=0
end
if pad:left() and oldpad:left()~=pad:left() and loda>=5 then
left="left"
save()
loda=0
lod=0
end
if pad:right() and oldpad:right()~=pad:right() and loda>=5 then
left="right"
save()
loda=0
lod=0
end
if pad:up() and oldpad:up()~=pad:up() and loda>=5 then
left="up"
save()
loda=0
lod=0
end
if pad:down() and oldpad:down()~=pad:down() and loda>=5 then
left="down"
save()
loda=0
lod=0
end
if pad:l() and oldpad:l()~=pad:l() and loda>=5 then
left="l"
save()
lod=0
end
if pad:r() and oldpad:r()~=pad:r() and loda>=5 then
left="r"
save()
loda=0
lod=0
end
end
if qr==3 then
if pad:cross() and oldpad:cross()~=pad:cross() and loda>=5 then
right="cross"
save()
loda=0
lod=0
end
if pad:square() and oldpad:square()~=pad:square() and loda>=5 then
right="square"
save()
loda=0
lod=0
end
if pad:triangle() and oldpad:triangle()~=pad:triangle() and loda>=5 then
right="triangle"
save()
loda=0
lod=0
end
if pad:circle() and oldpad:circle()~=pad:circle() and loda>=5 then
right="circle"
save()
loda=0
lod=0
end
if pad:left() and oldpad:left()~=pad:left() and loda>=5 then
right="left"
save()
loda=0
lod=0
end
if pad:right() and oldpad:right()~=pad:right() and loda>=5 then
right="right"
save()
loda=0
lod=0
end
if pad:up() and oldpad:up()~=pad:up() and loda>=5 then
right="up"
save()
loda=0
lod=0
end
if pad:down() and oldpad:down()~=pad:down() and loda>=5 then
right="down"
save()
loda=0
lod=0
end
if pad:l() and oldpad:l()~=pad:l() and loda>=5 then
right="l"
save()
loda=0
lod=0
end
if pad:r() and oldpad:r()~=pad:r() and loda>=5 then
right="r"
save()
loda=0
lod=0
end
end
if qr==4 then
if pad:cross() and oldpad:cross()~=pad:cross() and loda>=5 then
fire="cross"
save()
loda=0
lod=0
end
if pad:square() and oldpad:square()~=pad:square() and loda>=5 then
fire="square"
save()
loda=0
lod=0
end
if pad:triangle() and oldpad:triangle()~=pad:triangle() and loda>=5 then
fire="triangle"
save()
loda=0
lod=0
end
if pad:circle() and oldpad:circle()~=pad:circle() and loda>=5 then
fire="circle"
save()
loda=0
lod=0
end
if pad:left() and oldpad:left()~=pad:left() and loda>=5 then
fire="left"
save()
loda=0
lod=0
end
if pad:right() and oldpad:right()~=pad:right() and loda>=5 then
fire="right"
save()
loda=0
lod=0
end
if pad:up() and oldpad:up()~=pad:up() and loda>=5 then
fire="up"
save()
loda=0
lod=0
end
if pad:down() and oldpad:down()~=pad:down() and loda>=5 then
fire="down"
save()
loda=0
lod=0
end
if pad:l() and oldpad:l()~=pad:l() and loda>=5 then
fire="l"
save()
loda=0
lod=0
end
if pad:r() and oldpad:r()~=pad:r() and loda>=5 then
fire="r"
save()
loda=0
lod=0
end
end
end
screen:fontPrint(font,280,47,"Jump",red)
screen:fontPrint(font,280,97,"Go Left",red)
screen:fontPrint(font,280,147,"Go Right",red)
screen:fontPrint(font,280,197,"Fire",red)
screen:fontPrint(font,218,247,"Back",red)
screen:fontPrint(font,153,47,jump,red)
screen:fontPrint(font,153,97,left,red)
screen:fontPrint(font,153,147,right,red)
screen:fontPrint(font,153,197,fire,red)
if pad:select() then
file=io.open("data/makesave/screenshoter.msn","r")
nscreen=tonumber(file:read())
file:close()
screen:save("data/screenshot/SHOT"..nscreen..".png")
nscreen=nscreen+1
file=io.open("data/makesave/screenshoter.msn","w")
file:write(math.ceil(nscreen))
file:close()
end
screen:flip()
oldpad=pad
end