--88________88888______888____888888
--88_______88___88_____888____88___88
--88______88_____88____8_8____88____88
--88______88_____88___88_88___88____88
--88______88_____88___88__8___88____88
--88______88_____88___8___8___88____88
--88______88_____88__8888888__88____88
--88_______88___88___88___88__88___88
--888888____88888___88_____88_888888

png=0--priravnivanie png=0
font55=Font.load("data/font/qwe2.ttf")--zagruzka shrifta
font55:setPixelSizes(30,30)--vibor razmera shrifta
file=io.open("data/lang/lang.ini","r")
lang=tonumber(file:read())
file:close()
file=io.open("data/makesave/save24.msn","r")--schitivanie dannih iz faila
saver=file:read()--zapominanie ih vo vremennuu peremennuu
file:close()--zakritie faila
if tonumber(lang)==2 then
fonit=Image.load("data/img/pazl/fonit.png")
if tonumber(saver)==1 then
cp1=Image.load("data/load/cp1.png")
end
if tonumber(saver)==2 then
cp2=Image.load("data/load/cp2.png")
end
if tonumber(saver)==3 then
cp3=Image.load("data/load/cp3.png")
end
if tonumber(saver)==4 then
cp4=Image.load("data/load/cp4.png")
end
if tonumber(saver)==5 then
cp5=Image.load("data/load/cp5.png")
end
if tonumber(saver)==6 then
cp6=Image.load("data/load/cp6.png")
end
end
if tonumber(lang)==1 then
fonit=Image.load("data/img/pazl/fonit_eng.png")
if tonumber(saver)==1 then
cp1=Image.load("data/load/cp1_eng.png")
end
if tonumber(saver)==2 then
cp2=Image.load("data/load/cp2_eng.png")
end
if tonumber(saver)==3 then
cp3=Image.load("data/load/cp3_eng.png")
end
if tonumber(saver)==4 then
cp4=Image.load("data/load/cp4_eng.png")
end
if tonumber(saver)==5 then
cp5=Image.load("data/load/cp5_eng.png")
end
if tonumber(saver)==6 then
cp6=Image.load("data/load/cp6_eng.png")
end
end

function nill()
cp1=nil
cp2=nil
cp3=nil
cp4=nil
cp5=nil
end

if tonumber(saver)==6 then
Mp3me.stop()--ostanovka musiki
Mp3me.load("data/sound/5.mp3")--zagruzka musiki
Mp3me.play()--igrat
else
Mp3me.stop()--ostanovka musiki
Mp3me.load("data/sound/2.mp3")--zagruzka musiki
Mp3me.play()--igrat
end

local pina={3}--sozdanie massiva
pina[1]=255--prisvaivanie 1 elementu massiva pina znachenia = 255
pina[2]=255--prisvaivanie 2 elementu massiva pina znachenia = 255
pina[3]=255--prisvaivanie 3 elementu massiva pina znachenia = 255

if tonumber(saver)==1 then--esli otkrit tolko pervii uroven to
if z<0 then
Mp3me.play()
dofile("data/scripts/a.cpp")
end
end

while math.ceil(png)<300 do
screen:clear()--ochistka ekrana
pad = Controls.read()--podgruzka knopok psp

if pina[1]>0 and pinas==0 then
pina[1]=pina[1]-10
pina[2]=pina[2]-10
pina[3]=pina[3]-10
black=Color.new(pina[1],pina[2],pina[3])
else
pinas=1
end
if pina[1]<255 and pinas==1 then
pina[1]=pina[1]+10
pina[2]=pina[2]+10
pina[3]=pina[3]+10
black=Color.new(pina[1],pina[2],pina[3])
else
pinas=0
end

screen:blit(0,0,load)

if tonumber(saver)==1 then
screen:blit(0,0,cp1)
end
if tonumber(saver)==2 then
screen:blit(0,0,cp2)
end
if tonumber(saver)==3 then
screen:blit(0,0,cp3)
end
if tonumber(saver)==4 then
screen:blit(0,0,cp4)
end
if tonumber(saver)==5 then
screen:blit(0,0,cp5)
end
if tonumber(saver)==6 then
screen:blit(0,0,cp6)
end

screen:fontPrint(font55,350,260,"LOADING",black)
screen:flip()
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
oldpad=pad
if tonumber(saver)==6 then
png=png+0.2
else
png=png+1
end
end

Mp3me.stop()--ostanovka musiki
Mp3me.load("data/sound/2.mp3")
Mp3me.play()
if tonumber(saver)==1 then
x=25
z=0
buu=1
nill()
dofile("data/scripts/a.cpp")
end
if tonumber(saver)==2 then
nill()
dofile("data/img/pazl/cross.cpp")
end
if tonumber(saver)==3 then
nill()
dofile("data/scripts/b.cpp")
end
if tonumber(saver)==4 then
x=199
z=0
Mp3me.stop()--ostanovka musiki
Mp3me.load("data/sound/6.mp3")--zagruzka musiki
Mp3me.play()--igrat
file=io.open("data/nastroi/gun.CPP","r")--otkritie storonnego faila
gunkol=file:read()--kod dlia ego schitivania
file:close()--ostanovka schitivania
nill()
dofile("data/scripts/c.cpp")
end
if tonumber(saver)==5 then
nill()
dofile("data/scripts/d.cpp")
end
if tonumber(saver)==6 then
file=io.open("data/makesave/save24.msn","w")
file:write(5)
file:close()
nill()
dofile("data/scripts/about.cpp")
end