local select = 1;
local info = 1;
local music = 1;
scoresave = false
loadgame = true
smokeivisible = 0
shockstart = false
shtimer = 0
n = 0
sx = -100
sy = -100
x = - 133
y = 0
stimer = 0
introtimer = 1
introgamma = 0
bara = false
timer = 0
walla = false
starttimer = 0
coefficienta = 0
coefficient = 0
controla = false
selecta = true
choosea = true
aira = false
dirta = false
airc = false
firebiga = false
firea = false
firec = false
watera = false
waterc = false
grounda = false
groundc = false
energya = false
steama = false
booma = false
boomb = 0
electricitya = false
icea = false
iceb = 0
hesa = false
hesb = 0
copecka = false
copeckb = 0
deserta = false
desertb = 0
skya = false
skyb = 0
thunderconductora = false
thunderconductorb = 0
timea = false
timeb = 0
oceana = false
oceanb = 0
economya = false
economyb = 0
iceberga = false
icebergb = 0
metala = false
metalb = 0
sandwatcha = false
sandwatchb = 0
silicona = false
siliconb = 0
vinegara = false
vinegarb = 0
oldlampa = false
oldlampb = 0
lawlampa = false
lawlampb = 0
gasa = false
gasb = 0
cupa = false
cupb = 0
timea = false
timeb = 0
glassc = false
thunderconductora = false
thunderconductorb = 0
deserta = false
desertb = 0
lampa = false
lampb = 0
lighta = false
lightb = 0
smokea = false
smokeb = 0
ashesa = false
ashesb = 0
lavaa = false
lavab = 0
spirita = false
spiritb = 0
dusta = false
dustb = 0
winda = false
windb = 0
pressurea = false
pressureb = 0
seaa = false
seac = false
seab = 0
boga = false
bogb = 0
vodkaa = false
vodkab = 0
stonea = false
stoneb = 0
muda = false
mudb = 0
storma = false
stormb = 0
volcanoa = false
volcanob = 0
powdera = false
powderb = 0
geysera = false
geyserb = 0
clouda = false
cloudb = 0
sanda = false
sandb = 0
bacterya = false
bacteryb = 0
claya = false
clayb = 0
lifea = false
lifeb = 0
beacha = false
beachb = 0
islanda = false
islandb = 0
bricka = false
brickb = 0
brickc = false
boilera = false
boilerb = 0
electroa = false
electrob = 0
sounda = false
soundb = 0
silicona = false
siliconb = 0
walla = false
wallb = 0
peata = false
peatb = 0
dama = false
damb = 0
cgwa = false
cgwb = 0
glassa = false
glassb = 0
thundera = false
thunderb = 0
hha = false
hhb = 0
ooa = false
oob = 0
oooa = false
ooob = 0
saltb = 0
typhoonb = 0
molotovb = 0
whiskyb = 0
tempestb = 0
snowflakeb = 0
rustb = 0
earthquakeb = 0
fenixb = 0
bacterya = false
bacteryb = 0
aquaticplanta = false
aquaticplantb = 0
egga = false
eggb = 0
fireelema = false
fireelemb = 0
humana = false
humanb = 0
phantoma = false
phantomb = 0
warriora = false
warriorb = 0
holema = false
holemb = 0
holemlawa = false
holemlawb = 0
holemmeta = fale
holemmetb = 0
treea = false
treec = false
treeb = 0
seeda = false
seedb = 0
mitea = false
miteb = 0
chickena = false
chickenb = 0
alcogolica = false
alcogolicb = 0
planktona = false
planktonb = 0
robota = false
robotb = 0
fenixa = false
fenixb = 0
cactila = false
cactilb = 0
treesa = false
treesc = false
treesb = 0
dilemmaa = false
dilemmab = 0
fegga = false
feggb = 0
perfumea = false
perfumeb = 0
foresta = false
forestb = 0
totoroa = false
totorob = 0
fca = false
fcb = 0
entsa = false
entsb = 0
coala = false
coalb = 0
petria = false
petrib = 0
diamonda = false
diamondb = 0
ectoplasma = false
ectoplasmb = 0
ioda = false
iodb = 0
sua =false
sub = 0
worma =false
wormb = 0
sushia = false
sushib = 0
caviarea = false
caviareb = 0
fisha = false
fishc = false
hpsa = false
fishb = 0
elfisha = false
elfishb = 0
tekilaa = false
tekilab = 0
snaila = false
snailb = 0
shella = false
shellb = 0
pearla = false
pearlb = 0
ctreea = false
ctreeb = 0
canea = false
caneb = 0
caramela = false
caramelb = 0
cementa = false
cementb = 0
elephanta = false
elephantb = 0
ferna = false
fernb = 0
grassa = false
grassb = 0
lichena = false
lichenb = 0
limea = false
limeb = 0
limestonea = false
limestoneb = 0
mossa = false
mossb = 0
mushrooma = false
mushroomb = 0
sugara = false
sugarb = 0
tobaccoa = false
tobaccob = 0
whalea = false
whaleb = 0
smokestart = false
while pge.running() do
 pge.controls.update()
 pge.gfx.startdrawing()
 pge.gfx.clearscreen()
 pge.controls.update()
if loadgame == true then
	dofile("savegame/energysave.cfg")
	dofile("savegame/dustsave.cfg")
	dofile("savegame/steamsave.cfg")
	dofile("savegame/lavasave.cfg")
	dofile("savegame/spiritsave.cfg")
	dofile("savegame/stonesave.cfg")
	dofile("savegame/bogsave.cfg")
	dofile("savegame/sandsave.cfg")
	dofile("savegame/pressuresave.cfg")
	dofile("savegame/claysave.cfg")
	dofile("savegame/geysersave.cfg")
	dofile("savegame/vodkasave.cfg")
	dofile("savegame/beachsave.cfg")
	dofile("savegame/seasave.cfg")
	dofile("savegame/ooosave.cfg")
	dofile("savegame/hhsave.cfg")
	dofile("savegame/rustsave.cfg")
	dofile("savegame/dirtsave.cfg")
	dofile("savegame/icesave.cfg")
	dofile("savegame/hpssave.cfg")
	dofile("savegame/wallsave.cfg")
	dofile("savegame/bricksave.cfg")
	dofile("savegame/volcanosave.cfg")
	dofile("savegame/gassave.cfg")
	dofile("savegame/damsave.cfg")
	dofile("savegame/electricitysave.cfg")
	dofile("savegame/firebigsave.cfg")
	dofile("savegame/windsave.cfg")
	dofile("savegame/glasssave.cfg")
	dofile("savegame/metalsave.cfg")
	dofile("savegame/powdersave.cfg")
	dofile("savegame/score.cfg")
	file_dummysave = io.open("savegame/dummysave.cfg","w")
	file_dummysave:write("dummy = 0")
	file_dummysave:close()
	loadgame = false
end
bg:activate();
bg:draweasy(0,0,0,introgamma)
if starttimer == 0 then
	introtimer = 1
end
if select == 1 and selecta == true and bara == true then
	sel:activate();
	sel:draweasy(0,32+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) then
		aira = true
		coefficient = coefficient + 1
	end
end
if select == 1 and selecta == true and bara == true then
	sel:activate();
	sel:draweasy(0,32+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CIRCLE) then
		airc = true
		coefficient = coefficient + 1
	end
end
if aira == true and choosea == true or airc == true and choosea == true then
	cho:activate();
	cho:draweasy(0,32+n,0,255);
end
if select == 2 and selecta == true then
	sel:activate();
	sel:draweasy(40,32+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) then
		firea = true
		coefficient = coefficient + 1
	end
end
if select == 2 and selecta == true and bara == true and choosea == true  then
	sel:activate();
	sel:draweasy(40,32+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CIRCLE) then
		firec = true
		coefficient = coefficient + 1
	end
end
if firea == true or firec == true and choosea == true then
	cho:activate();
	cho:draweasy(40,32+n,0,255);
end
if select == 3 and selecta == true then
	sel:activate();
	sel:draweasy(80,32+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) then
		watera = true
		coefficient = coefficient + 1
	end
end
if select == 3 and selecta == true then
	sel:activate();
	sel:draweasy(80,32+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CIRCLE) then
		waterc = true
	end
end
if watera == true or waterc == true then
	cho:activate();
	cho:draweasy(80,32+n,0,255);
end
if select == 4 and selecta == true then
	sel:activate();
	sel:draweasy(120,32+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) then
		grounda = true
		coefficient = coefficient + 1
	end
end
if select == 4 and selecta == true then
	sel:activate();
	sel:draweasy(120,32+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CIRCLE) then
		groundc = true
		coefficient = coefficient + 1
	end
end
if grounda == true or groundc == true then
	cho:activate();
	cho:draweasy(120,32+n,0,255);
end


if select == 5 and selecta == true then
	sel:activate();
	sel:draweasy(160,32+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and steamsave == 1 then
		steama = true
		coefficient = coefficient + 1
	end
end
if steama == true then
	cho:activate();
	cho:draweasy(160,32+n,0,255);
end
if aira == true and watera == true and steamsave == 0 then
	score = score + 1
	scoresave = true
end
if aira == true and watera == true and bara == true then
	smokestart = true 
	steamsave = 1
	sx = 160
	sy = 32+n
	file_steamsave = io.open("savegame/steamsave.cfg","w")
	file_steamsave:write("steamsave = 1")
	file_steamsave:close()
	sfx_steam:play()
	aira = false
	watera = false
end
if steamsave == 1 and bara == true then
	steam:activate();
	steam:draweasy(160,32+n,0,255);
end


if select == 6 and selecta == true then
	sel:activate();
	sel:draweasy(200,32+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and energysave == 1 then
		energya = true
		coefficient = coefficient + 1
	end
end
if energya == true then
	cho:activate();
	cho:draweasy(200,32+n,0,255);
end
if aira == true and firea == true and energysave == 0 then
	score = score + 1
	scoresave = true
end
if aira == true and firea == true and bara == true then
	shockstart = true 
	energysave = 1
	sx = 200
	sy = 32+n
	file_energysave = io.open("savegame/energysave.cfg","w")
	file_energysave:write("energysave = 1")
	file_energysave:close()
	sfx_energy:play()
	aira = false
	watera = false
end
if energysave == 1 and bara == true then
	energy:activate();
	energy:draweasy(200,32+n,0,255);
end


if select == 7 and selecta == true then
	sel:activate();
	sel:draweasy(240,32+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and dustsave == 1 then
		dusta = true
		coefficient = coefficient + 1
	end
end
if dusta == true then
	cho:activate();
	cho:draweasy(240,32+n,0,255);
end
if aira == true and grounda == true and dustsave == 0 then
	score = score + 1
	scoresave = true
end
if aira == true and grounda == true and bara == true then
	smokestart = true 
	dustsave = 1
	sx = 240
	sy = 32+n
	file_dustsave = io.open("savegame/dustsave.cfg","w")
	file_dustsave:write("dustsave = 1")
	file_dustsave:close()
	sfx_achuh:play()
	aira = false
	grounda = false
end
if dustsave == 1 and bara == true then
	dust:activate();
	dust:draweasy(240,32+n,0,255);
end


if select == 8 and selecta == true then
	sel:activate();
	sel:draweasy(280,32+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and lavasave == 1 then
		lavaa = true
		coefficient = coefficient + 1
	end
end
if lavaa == true then
	cho:activate();
	cho:draweasy(280,32+n,0,255);
end
if firea == true and grounda == true and lavasave == 0 then
	score = score + 1
	scoresave = true
end
if firea == true and grounda == true and bara == true then
	smokestart = true 
	lavasave = 1
	sx = 280
	sy = 32+n
	file_lavasave = io.open("savegame/lavasave.cfg","w")
	file_lavasave:write("lavasave = 1")
	file_lavasave:close()
	sfx_water:play()
	firea = false
	grounda = false
end
if lavasave == 1 and bara == true then
	lava:activate();
	lava:draweasy(280,32+n,0,255);
end


if select == 9 and selecta == true then
	sel:activate();
	sel:draweasy(320,32+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and bogsave == 1 then
		boga = true
		coefficient = coefficient + 1
	end
end
if boga == true then
	cho:activate();
	cho:draweasy(320,32+n,0,255);
end
if watera == true and grounda == true and bogsave == 0 then
	score = score + 1
	scoresave = true
end
if watera == true and grounda == true and bara == true then
	smokestart = true 
	bogsave = 1
	sx = 320
	sy = 32+n
	file_bogsave = io.open("savegame/bogsave.cfg","w")
	file_bogsave:write("bogsave = 1")
	file_bogsave:close()
	sfx_water:play()
	watera = false
	grounda = false
end
if bogsave == 1 and bara == true then
	bog:activate();
	bog:draweasy(320,32+n,0,255);
end


if select == 10 and selecta == true then
	sel:activate();
	sel:draweasy(360,32+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and spiritsave == 1 then
		spirita = true
		coefficient = coefficient + 1
	end
end
if spirita == true then
	cho:activate();
	cho:draweasy(360,32+n,0,255);
end
if watera == true and firea == true and bara == true and spiritsave == 0 then
	shockstart = true 
	score = score + 1
	scoresave = true
	spiritsave = 1
	sx = 360
	sy = 32+n
	file_spiritsave = io.open("savegame/spiritsave.cfg","w")
	file_spiritsave:write("spiritsave = 1")
	file_spiritsave:close()
	sfx_water:play()
	watera = false
	firea = false
end
if spiritsave == 1 and bara == true then
	spirit:activate();
	spirit:draweasy(360,32+n,0,255);
end



if select == 11 and selecta == true then
	sel:activate();
	sel:draweasy(400,32+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and stonesave == 1 then
		stonea = true
		coefficient = coefficient + 1
	end
end
if stonea == true then
	cho:activate();
	cho:draweasy(400,32+n,0,255);
end
if watera == true and lavaa == true and stonesave == 0 then
	scoresave = true
	score = score + 1
end
if watera == true and lavaa == true and bara == true then
	smokestart = true 
	stonesave = 1
	sx = 400
	sy = 32+n
	file_stonesave = io.open("savegame/stonesave.cfg","w")
	file_stonesave:write("stonesave = 1")
	file_stonesave:close()
	sfx_steam:play()
	watera = false
	lavaa = false
end
if stonesave == 1 and bara == true then
	stone:activate();
	stone:draweasy(400,32+n,0,255);
end


if select == 12 and selecta == true then
	sel:activate();
	sel:draweasy(440,32+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and sandsave == 1 then
		sanda = true
		coefficient = coefficient + 1
	end
end
if sanda == true then
	cho:activate();
	cho:draweasy(440,32+n,0,255);
end
if stonea == true and aira == true and sandsave == 0 then
	score = score + 1
	scoresave = true
end
if stonea == true and aira == true and bara == true then
	smokestart = true 
	sandsave = 1
	sx = 440
	sy = 32+n
	file_sandsave = io.open("savegame/sandsave.cfg","w")
	file_sandsave:write("sandsave = 1")
	file_sandsave:close()
	sfx_wind:play()
	stonea = false
	aira = false
end
if sandsave == 1 and bara == true then
	sand:activate();
	sand:draweasy(440,32+n,0,255);
end



if select == 13 and selecta == true then
	sel:activate();
	sel:draweasy(0,72+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and windsave == 1 then
		winda = true
		coefficient = coefficient + 1
	end
end
if winda == true then
	cho:activate();
	cho:draweasy(0,72+n,0,255);
end
if airc == true and aira == true and windsave == 0 then
	score = score + 1
	scoresave = true
end
if airc == true and aira == true and bara == true then
	smokestart = true 
	windsave = 1
	sx = 0
	sy = 72+n
	file_windsave = io.open("savegame/windsave.cfg","w")
	file_windsave:write("windsave = 1")
	file_windsave:close()
	sfx_wind:play()
	airc = false
	aira = false
end
if windsave == 1 and bara == true then
	wind:activate();
	wind:draweasy(0,72+n,0,255);
end



if select == 14 and selecta == true then
	sel:activate();
	sel:draweasy(40,72+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and firebigsave == 1 then
		firebiga = true
		coefficient = coefficient + 1
	end
end
if firebiga == true then
	cho:activate();
	cho:draweasy(40,72+n,0,255);
end
if firec == true and firea == true and firebigsave == 0 then
	score = score + 1
	scoresave = true
end
if firec == true and firea == true and bara == true then
	shockstart = true 
	firebigsave = 1
	sx = 40
	sy = 72+n
	file_firebigsave = io.open("savegame/firebigsave.cfg","w")
	file_firebigsave:write("firebigsave = 1")
	file_firebigsave:close()
	sfx_alert:play()
	firec = false
	firea = false
end
if firebigsave == 1 and bara == true then
	firebig:activate();
	firebig:draweasy(40,72+n,0,255);
end



if select == 15 and selecta == true then
	sel:activate();
	sel:draweasy(80,72+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and seasave == 1 then
		seaa = true
		coefficient = coefficient + 1
	end
end
if seaa == true then
	cho:activate();
	cho:draweasy(80,72+n,0,255);
end
if waterc == true and watera == true and seasave == 0 then
	score = score + 1
	scoresave = true
end
if waterc == true and watera == true and bara == true then
	smokestart = true 
	seasave = 1
	sx = 80
	sy = 72+n
	file_seasave = io.open("savegame/seasave.cfg","w")
	file_seasave:write("seasave = 1")
	file_seasave:close()
	sfx_sea:play()
	waterc = false
	watera = false
end
if seasave == 1 and bara == true then
	sea:activate();
	sea:draweasy(80,72+n,0,255);
end



if select == 16 and selecta == true then
	sel:activate();
	sel:draweasy(120,72+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and pressuresave == 1 then
		pressurea = true
		coefficient = coefficient + 1
	end
end
if pressurea == true then
	cho:activate();
	cho:draweasy(120,72+n,0,255);
end
if groundc == true and grounda == true and pressuresave == 0 then
	score = score + 1
	scoresave = true
end
if groundc == true and grounda == true and bara == true then
	smokestart = true 
	pressuresave = 1
	sx = 120
	sy = 72+n
	file_pressuresave = io.open("savegame/pressuresave.cfg","w")
	file_pressuresave:write("pressuresave = 1")
	file_pressuresave:close()
	sfx_steam:play()
	groundc = false
	grounda = false
end
if pressuresave == 1 and bara == true then
	pressure:activate();
	pressure:draweasy(120,72+n,0,255);
end


if select == 17 and selecta == true then
	sel:activate();
	sel:draweasy(160,72+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and metalsave == 1 then
		metala = true
		coefficient = coefficient + 1
	end
end
if metala == true then
	cho:activate();
	cho:draweasy(160,72+n,0,255);
end
if stonea == true and firea == true and metalsave == 0 then
	score = score + 1
	scoresave = true
end
if stonea == true and firea == true and bara == true then
	smokestart = true 
	metalsave = 1
	sx = 160
	sy = 72+n
	file_metalsave = io.open("savegame/metalsave.cfg","w")
	file_metalsave:write("metalsave = 1")
	file_metalsave:close()
	sfx_steam:play()
	stonea = false
	firea = false
end
if metalsave == 1 and bara == true then
	metal:activate();
	metal:draweasy(160,72+n,0,255);
end


if select == 18 and selecta == true then
	sel:activate();
	sel:draweasy(200,72+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and powdersave == 1 then
		powdera = true
		coefficient = coefficient + 1
	end
end
if powdera == true then
	cho:activate();
	cho:draweasy(200,72+n,0,255);
end
if dusta == true and firea == true and powdersave == 0 then
	score = score + 1
	scoresave = true
end
if dusta == true and firea == true and bara == true then
	shockstart = true 
	powdersave = 1
	sx = 200
	sy = 72+n
	file_powdersave = io.open("savegame/powdersave.cfg","w")
	file_powdersave:write("powdersave = 1")
	file_powdersave:close()
	sfx_boom:play()
	dusta = false
	firea = false
end
if powdersave == 1 and bara == true then
	powder:activate();
	powder:draweasy(200,72+n,0,255);
end



if select == 19 and selecta == true then
	sel:activate();
	sel:draweasy(240,72+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and glasssave == 1 then
		glassa = true
		coefficient = coefficient + 1
	end
end
if glassa == true then
	cho:activate();
	cho:draweasy(240,72+n,0,255);
end
if sanda == true and firea == true and glasssave == 0 then
	score = score + 1
	scoresave = true
end
if sanda == true and firea == true and bara == true then
	smokestart = true 
	glasssave = 1
	sx = 240
	sy = 72+n
	file_glasssave = io.open("savegame/glasssave.cfg","w")
	file_glasssave:write("glasssave = 1")
	file_glasssave:close()
	sfx_steam:play()
	sanda = false
	firea = false
end
if glasssave == 1 and bara == true then
	glass:activate();
	glass:draweasy(240,72+n,0,255);
end


if select == 20 and selecta == true then
	sel:activate();
	sel:draweasy(280,72+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and vodkasave == 1 then
		vodkaa = true
		coefficient = coefficient + 1
	end
end
if vodkaa == true then
	cho:activate();
	cho:draweasy(280,72+n,0,255);
end
if watera == true and spirita == true and vodkasave == 0 then
	score = score + 1
	scoresave = true
end
if watera == true and spirita == true and bara == true then
	smokestart = true 
	vodkasave = 1
	sx = 280
	sy = 72+n
	file_vodkasave = io.open("savegame/vodkasave.cfg","w")
	file_vodkasave:write("vodkasave = 1")
	file_vodkasave:close()
	sfx_vodka:play()
	watera = false
	spirita = false
end
if vodkasave == 1 and bara == true then
	vodka:activate();
	vodka:draweasy(280,72+n,0,255);
end


if select == 21 and selecta == true then
	sel:activate();
	sel:draweasy(320,72+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and geysersave == 1 then
		geysera = true
		coefficient = coefficient + 1
	end
end
if geysera == true then
	cho:activate();
	cho:draweasy(320,72+n,0,255);
end
if grounda == true and steama == true and geysersave == 0 then
	score = score + 1
	scoresave = true
end
if grounda == true and steama == true and bara == true then
	smokestart = true 
	geysersave = 1
	sx = 320
	sy = 72+n
	file_geysersave = io.open("savegame/geysersave.cfg","w")
	file_geysersave:write("geysersave = 1")
	file_geysersave:close()
	sfx_steam:play()
	sfx_water:play()
	grounda = false
	steama = false
end
if geysersave == 1 and bara == true then
	geyser:activate();
	geyser:draweasy(320,72+n,0,255);
end


if select == 22 and selecta == true then
	sel:activate();
	sel:draweasy(360,72+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and beachsave == 1 then
		beacha = true
		coefficient = coefficient + 1
	end
end
if beacha == true then
	cho:activate();
	cho:draweasy(360,72+n,0,255);
end
if seaa == true and sanda == true and beachsave == 0 or watera == true and sanda == true and beachsave == 0 then
	score = score + 1
	scoresave = true
end
if seaa == true and sanda == true and bara == true or watera == true and sanda == true and bara == true then
	smokestart = true 
	beachsave = 1
	sx = 360
	sy = 72+n
	file_beachsave = io.open("savegame/beachsave.cfg","w")
	file_beachsave:write("beachsave = 1")
	file_beachsave:close()
	sfx_sea:play()
	seaa = false
	watera = false
	sanda = false
end
if beachsave == 1 and bara == true then
	beach:activate();
	beach:draweasy(360,72+n,0,255);
end



if select == 23 and selecta == true then
	sel:activate();
	sel:draweasy(400,72+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and claysave == 1 then
		claya = true
		coefficient = coefficient + 1
	end
end
if claya == true then
	cho:activate();
	cho:draweasy(400,72+n,0,255);
end
if boga == true and sanda == true and claysave == 0 then
	score = score + 1
	scoresave = true
end
if boga == true and sanda == true and bara == true then
	smokestart = true 
	claysave = 1
	sx = 400
	sy = 72+n
	file_claysave = io.open("savegame/claysave.cfg","w")
	file_claysave:write("claysave = 1")
	file_claysave:close()
	sfx_water:play()
	boga = false
	sanda = false
end
if claysave == 1 and bara == true then
	clay:activate();
	clay:draweasy(400,72+n,0,255);
end



if select == 24 and selecta == true then
	sel:activate();
	sel:draweasy(440,72+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and electricitysave == 1 then
		electricitya = true
		coefficient = coefficient + 1
	end
end
if electricitya == true then
	cho:activate();
	cho:draweasy(440,72+n,0,255);
end
if energya == true and metala == true and electricitysave == 0 then
	score = score + 1
	scoresave = true
end
if energya == true and metala == true and bara == true then
	shockstart = true 
	electricitysave = 1
	sx = 440
	sy = 72+n
	file_electricitysave = io.open("savegame/electricitysave.cfg","w")
	file_electricitysave:write("electricitysave = 1")
	file_electricitysave:close()
	sfx_energy:play()
	energya = false
	metala = false
end
if electricitysave == 1 and bara == true then
	electricity:activate();
	electricity:draweasy(440,72+n,0,255);
end



if select == 25 and selecta == true then
	sel:activate();
	sel:draweasy(0,112+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and rustsave == 1 then
		rusta = true
		coefficient = coefficient + 1
	end
end
if rusta == true then
	cho:activate();
	cho:draweasy(0,112+n,0,255);
end
if watera == true and metala == true and rustsave == 0 then
	score = score + 1
	scoresave = true
end
if watera == true and metala == true and bara == true then
	shockstart = true 
	rustsave = 1
	sx = 0
	sy = 112+n
	file_rustsave = io.open("savegame/rustsave.cfg","w")
	file_rustsave:write("rustsave = 1")
	file_rustsave:close()
	sfx_energy:play()
	watera = false
	metala = false
end
if rustsave == 1 and bara == true then
	rust:activate();
	rust:draweasy(0,112+n,0,255);
end


if select == 26 and selecta == true then
	sel:activate();
	sel:draweasy(40,112+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and dirtsave == 1 then
		dirta = true
		coefficient = coefficient + 1
	end
end
if dirta == true then
	cho:activate();
	cho:draweasy(40,112+n,0,255);
end
if watera == true and dusta == true and dirtsave == 0 then
	score = score + 1
	scoresave = true
end
if watera == true and dusta == true and bara == true then
	shockstart = true 
	dirtsave = 1
	sx = 40
	sy = 112+n
	file_dirtsave = io.open("savegame/dirtsave.cfg","w")
	file_dirtsave:write("dirtsave = 1")
	file_dirtsave:close()
	sfx_water:play()
	watera = false
	dusta = false
end
if dirtsave == 1 and bara == true then
	dirt:activate();
	dirt:draweasy(40,112+n,0,255);
end


if select == 27 and selecta == true then
	sel:activate();
	sel:draweasy(80,112+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and icesave == 1 then
		icea = true
		coefficient = coefficient + 1
	end
end
if icea == true then
	cho:activate();
	cho:draweasy(80,112+n,0,255);
end
if watera == true and glassa == true and icesave == 0 then
	score = score + 1
	scoresave = true
end
if watera == true and glassa == true and bara == true then
	shockstart = true 
	icesave = 1
	sx = 80
	sy = 112+n
	file_icesave = io.open("savegame/icesave.cfg","w")
	file_icesave:write("icesave = 1")
	file_icesave:close()
	sfx_wind:play()
	watera = false
	glassa = false
end
if icesave == 1 and bara == true then
	ice:activate();
	ice:draweasy(80,112+n,0,255);
end


if select == 28 and selecta == true then
	sel:activate();
	sel:draweasy(120,112+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and hhsave == 1 then
		hha = true
		coefficient = coefficient + 1
	end
end
if hha == true then
	cho:activate();
	cho:draweasy(120,112+n,0,255);
end
if select == 29 and selecta == true then
	sel:activate();
	sel:draweasy(160,112+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and hhsave == 1 then
		ooa = true
		coefficient = coefficient + 1
	end
end
if ooa == true then
	cho:activate();
	cho:draweasy(160,112+n,0,255);
end
if watera == true and electricitya == true and hhsave == 0 then
	score = score + 2
	scoresave = true
end
if watera == true and electricitya == true and bara == true then
	shockstart = true 
	smokestart = true 
	hhsave = 1
	sx = 140
	sy = 112+n
	sfx_steam:play()
	file_hhsave = io.open("savegame/hhsave.cfg","w")
	file_hhsave:write("hhsave = 1")
	file_hhsave:close()
	sfx_energy:play()
	watera = false
	electricitya = false
end
if hhsave == 1 and bara == true then
	hh:activate();
	hh:draweasy(120,112+n,0,255);
	oo:activate();
	oo:draweasy(160,112+n,0,255);
end


if select == 30 and selecta == true then
	sel:activate();
	sel:draweasy(200,112+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and ooosave == 1 then
		oooa = true
		coefficient = coefficient + 1
	end
end
if oooa == true then
	cho:activate();
	cho:draweasy(200,112+n,0,255);
end
if aira == true and electricitya == true and ooosave == 0 then
	score = score + 1
	scoresave = true
end
if aira == true and electricitya == true and bara == true then
	shockstart = true 
	ooosave = 1
	sx = 200
	sy = 112+n
	file_ooosave = io.open("savegame/ooosave.cfg","w")
	file_ooosave:write("ooosave = 1")
	file_ooosave:close()
	sfx_energy:play()
	aira = false
	electricitya = false
end
if ooosave == 1 and bara == true then
	ooo:activate();
	ooo:draweasy(200,112+n,0,255);
end



if select == 31 and selecta == true then
	sel:activate();
	sel:draweasy(240,112+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and gassave == 1 then
		gasa = true
		coefficient = coefficient + 1
	end
end
if gasa == true then
	cho:activate();
	cho:draweasy(240,112+n,0,255);
end
if ooa == true and hha == true and gassave == 0 then
	score = score + 1
	scoresave = true
end
if ooa == true and hha == true and bara == true then
	steamstart = true 
	gassave = 1
	sx = 240
	sy = 112+n
	file_gassave = io.open("savegame/gassave.cfg","w")
	file_gassave:write("gassave = 1")
	file_gassave:close()
	sfx_steam:play()
	ooa = false
	hha = false
end
if gassave == 1 and bara == true then
	gas:activate();
	gas:draweasy(240,112+n,0,255);
end


if select == 32 and selecta == true then
	sel:activate();
	sel:draweasy(280,112+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and volcanosave == 1 then
		volcanoa = true
		coefficient = coefficient + 1
	end
end
if volcanoa == true then
	cho:activate();
	cho:draweasy(280,112+n,0,255);
end
if lavaa == true and pressurea == true and volcanosave == 0 then
	score = score + 1
	scoresave = true
end
if lavaa == true and pressurea == true and bara == true then
	steamstart = true 
	volcanosave = 1
	sx = 280
	sy = 112+n
	file_volcanosave = io.open("savegame/volcanosave.cfg","w")
	file_volcanosave:write("volcanosave = 1")
	file_volcanosave:close()
	sfx_steam:play()
	lavaa = false
	pressurea = false
end
if volcanosave == 1 and bara == true then
	volcano:activate();
	volcano:draweasy(280,112+n,0,255);
end


if select == 33 and selecta == true then
	sel:activate();
	sel:draweasy(320,112+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and bricksave == 1 then
		bricka = true
		coefficient = coefficient + 1
	end
end
if bricka == true then
	cho:activate();
	cho:draweasy(320,112+n,0,255);
end
if select == 33 and selecta == true then
	sel:activate();
	sel:draweasy(320,112+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CIRCLE) and bricksave == 1 then
		brickc = true
		coefficient = coefficient + 1
	end
end
if brickc == true then
	cho:activate();
	cho:draweasy(320,112+n,0,255);
end
if firea == true and claya == true and bricksave == 0 then
	score = score + 1
	scoresave = true
end
if firea == true and claya == true and bara == true then
	steamstart = true 
	bricksave = 1
	sx = 320
	sy = 112+n
	file_bricksave = io.open("savegame/bricksave.cfg","w")
	file_bricksave:write("bricksave = 1")
	file_bricksave:close()
	sfx_steam:play()
	firea = false
	claya = false
end
if bricksave == 1 and bara == true then
	brick:activate();
	brick:draweasy(320,112+n,0,255);
end


if select == 34 and selecta == true then
	sel:activate();
	sel:draweasy(360,112+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and damsave == 1 then
		dama = true
		coefficient = coefficient + 1
	end
end
if dama == true then
	cho:activate();
	cho:draweasy(360,112+n,0,255);
end
if watera == true and bricka == true and damsave == 0 then
	score = score + 1
	scoresave = true
end
if watera == true and bricka == true and bara == true then
	steamstart = true 
	damsave = 1
	sx = 360
	sy = 112+n
	file_damsave = io.open("savegame/damsave.cfg","w")
	file_damsave:write("damsave = 1")
	file_damsave:close()
	sfx_construct:play()
	watera = false
	bricka = false
end
if damsave == 1 and bara == true then
	dam:activate();
	dam:draweasy(360,112+n,0,255);
end



if select == 35 and selecta == true then
	sel:activate();
	sel:draweasy(400,112+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and wallsave == 1 then
		walla = true
		coefficient = coefficient + 1
	end
end
if walla == true then
	cho:activate();
	cho:draweasy(400,112+n,0,255);
end
if brickc == true and bricka == true and wallsave == 0 then
	score = score + 1
	scoresave = true
end
if brickc == true and bricka == true and bara == true then
	steamstart = true 
	wallsave = 1
	sx = 400
	sy = 112+n
	file_wallsave = io.open("savegame/wallsave.cfg","w")
	file_wallsave:write("wallsave = 1")
	file_wallsave:close()
	sfx_construct:play()
	brickc = false
	bricka = false
end
if wallsave == 1 and bara == true then
	wall:activate();
	wall:draweasy(400,112+n,0,255);
end



if select == 36 and selecta == true then
	sel:activate();
	sel:draweasy(440,112+n,0,255);
	if pge.controls.pressed(PGE_CTRL_CROSS) and hpssave == 1 then
		hpsa = true
		coefficient = coefficient + 1
	end
end
if hpsa == true then
	cho:activate();
	cho:draweasy(440,112+n,0,255);
end
if electricitya == true and dama == true and hpssave == 0 then
	score = score + 1
	scoresave = true
end
if electricitya == true and dama == true and bara == true then
	shockstart = true 
	hpssave = 1
	sx = 440
	sy = 112+n
	file_hpssave = io.open("savegame/hpssave.cfg","w")
	file_hpssave:write("hpssave = 1")
	file_hpssave:close()
	sfx_energy:play()
	electricitya = false
	dama = false
end
if hpssave == 1 and bara == true then
	hps:activate();
	hps:draweasy(440,112+n,0,255);
end



if smokestart == true then
	stimer = stimer + 1
	y = y - 1
end
if stimer >= 1 and stimer <= 30 then
	smoke:activate();
	smoke:draweasy(sx+10+y,sy+10+y,0,255-smokeivisible);
	smoke:activate();
	smoke:draweasy(sx+10-y,sy+10-y,0,255-smokeivisible);
	smoke:activate();
	smoke:draweasy(sx+10-y,sy+10+y,0,255-smokeivisible);
	smoke:activate();
	smoke:draweasy(sx+10+y,sy+10-y,0,255-smokeivisible);
end
if stimer >= 10 and stimer <= 30  then
	smokeivisible = smokeivisible + 14
end
if stimer >= 30 then
	stimer = 0
	smokestart = false 
	sx = -1600
	sy = -3200
	y = 0
	smokeivisible = 0
end
if shockstart == true then
	shtimer = shtimer + 1
end
if shtimer >= 1 and shtimer <= 5  then
	shock:activate();
	shock:draweasy(sx-10,sy-10,0,255);
end
if shtimer >= 5 then
	shockstart = false
	shtimer = 0
end 
if bara == true then
	einstain:activate();
	einstain:draweasy(170,-700+n,0,255);
	lcchalk30:activate();
	lcchalk30:print(80, 1000+n, white, "Visit http://sgi. ucoz. com")
	air:activate();
	air:draweasy(0,32+n,0,255)
	fire:activate();
	fire:draweasy(40,32+n,0,255)
	water:activate();
	water:draweasy(80,32+n,0,255)
	ground:activate();
	ground:draweasy(120,32+n,0,255)
	bar:activate();
	bar:draweasy(0,0,0,introgamma)
	if pge.controls.analogy() > 64 then
		n = n + 1
	end
	if pge.controls.analogy() < -64 then
		n = n - 1
	end
	if pge.controls.analogy() > 32 then
		n = n + 1
	end
	if pge.controls.analogy() < -32 then
		n = n - 1
	end
	if pge.controls.analogy() > 96 then
		n = n + 1
	end
	if pge.controls.analogy() < -96 then
		n = n - 1
	end
	if score == 4 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "004/XXX")
	end
	if score == 5 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 5")
		file_scoresave:close()
		scoresave = false
	end
	if score == 5 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "005/XXX")
	end
	if score == 6 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 6")
		file_scoresave:close()
		scoresave = false
	end
	if score == 6 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "006/XXX")
	end
	if score == 7 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 7")
		file_scoresave:close()
		scoresave = false
	end
	if score == 7 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "007/XXX")
	end
	if score == 8 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 8")
		file_scoresave:close()
		scoresave = false
	end
	if score == 8 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "008/XXX")
	end
	if score == 9 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 9")
		file_scoresave:close()
		scoresave = false
	end
	if score == 9 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "009/XXX")
	end
	if score == 10 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 10")
		file_scoresave:close()
		scoresave = false
	end
	if score == 10 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "010/XXX")
	end
	if score == 11 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 11")
		file_scoresave:close()
		scoresave = false
	end
	if score == 11 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "011/XXX")
	end
	if score == 12 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 12")
		file_scoresave:close()
		scoresave = false
	end
	if score == 12 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "012/XXX")
	end
	if score == 13 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 13")
		file_scoresave:close()
		scoresave = false
	end
	if score == 13 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "013/XXX")
	end
	if score == 14 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 14")
		file_scoresave:close()
		scoresave = false
	end
	if score == 14 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "014/XXX")
	end
	if score == 15 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 15")
		file_scoresave:close()
		scoresave = false
	end
	if score == 15 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "015/XXX")
	end
	if score == 16 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 16")
		file_scoresave:close()
		scoresave = false
	end
	if score == 16 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "016/XXX")
	end
	if score == 17 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 17")
		file_scoresave:close()
		scoresave = false
	end
	if score == 17 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "017/XXX")
	end
	if score == 18 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 18")
		file_scoresave:close()
		scoresave = false
	end
	if score == 18 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "018/XXX")
	end
	if score == 19 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 19")
		file_scoresave:close()
		scoresave = false
	end
	if score == 19 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "019/XXX")
	end
	if score == 20 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 20")
		file_scoresave:close()
		scoresave = false
	end
	if score == 20 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "020/XXX")
	end
	if score == 21 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 21")
		file_scoresave:close()
		scoresave = false
	end
	if score == 21 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "021/XXX")
	end
	if score == 22 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 22")
		file_scoresave:close()
		scoresave = false
	end
	if score == 22 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "022/XXX")
	end
	if score == 23 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 23")
		file_scoresave:close()
		scoresave = false
	end
	if score == 23 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "023/XXX")
	end
	if score == 24 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 24")
		file_scoresave:close()
		scoresave = false
	end
	if score == 24 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "024/XXX")
	end
	if score == 25 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 25")
		file_scoresave:close()
		scoresave = false
	end
	if score == 25 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "025/XXX")
	end
	if score == 26 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 26")
		file_scoresave:close()
		scoresave = false
	end
	if score == 26 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "026/XXX")
	end
	if score == 27 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 27")
		file_scoresave:close()
		scoresave = false
	end
	if score == 27 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "027/XXX")
	end
	if score == 28 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 28")
		file_scoresave:close()
		scoresave = false
	end
	if score == 28 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "028/XXX")
	end
	if score == 29 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 29")
		file_scoresave:close()
		scoresave = false
	end
	if score == 29 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "029/XXX")
	end
	if score == 30 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 30")
		file_scoresave:close()
		scoresave = false
	end
	if score == 30 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "030/XXX")
	end
	if score == 31 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 31")
		file_scoresave:close()
		scoresave = false
	end
	if score == 31 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "031/XXX")
	end
	if score == 32 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 32")
		file_scoresave:close()
		scoresave = false
	end
	if score == 32 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "032/XXX")
	end
	if score == 33 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 33")
		file_scoresave:close()
		scoresave = false
	end
	if score == 33 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "033/XXX")
	end
	if score == 34 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 34")
		file_scoresave:close()
		scoresave = false
	end
	if score == 34 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "034/XXX")
	end
	if score == 35 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 35")
		file_scoresave:close()
		scoresave = false
	end
	if score == 35 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "035/XXX")
	end
	if score == 36 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 36")
		file_scoresave:close()
		scoresave = false
	end
	if score == 36 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "036/XXX")
	end
	if score == 37 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 37")
		file_scoresave:close()
		scoresave = false
	end
	if score == 37 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "037/XXX")
	end
	if score == 38 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 38")
		file_scoresave:close()
		scoresave = false
	end
	if score == 38 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "038/XXX")
	end
	if score == 39 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 39")
		file_scoresave:close()
		scoresave = false
	end
	if score == 39 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "039/XXX")
	end
	if score == 40 and scoresave == true then
		file_scoresave = io.open("savegame/score.cfg","w")
		file_scoresave:write("score = 40")
		file_scoresave:close()
		scoresave = false
	end
	if score == 40 then
		lcchalk:activate();
		lcchalk:print(280, 6, white, "040/XXX")
	end
end

if info == 1 then
	information:activate();
	information:draweasy(0,0,0,introgamma)
end
if info == 2 then
	control:activate();
	control:draweasy(0,0,0,introgamma)
end
if pge.controls.pressed(PGE_CTRL_LTRIGGER) then
	info = 1
end
if pge.controls.pressed(PGE_CTRL_RTRIGGER) then
	info = 2
end
if pge.controls.pressed(PGE_CTRL_START) then
	info = 0
	bara = true
end
if introtimer == 1 then
	introgamma = introgamma + 2;
	if introgamma >= 255 then
		starttimer = 1
		introgamma = 255;
	end
end

if pge.controls.pressed(PGE_CTRL_LEFT) and select > 0 then
	select = select - 1;
end
if pge.controls.pressed(PGE_CTRL_RIGHT) and select < 48 then
	select = select + 1;
end
if pge.controls.pressed(PGE_CTRL_UP) and select > 0 then
	select = select - 12;
end
if pge.controls.pressed(PGE_CTRL_DOWN) and select < 48 then
	select = select + 12;
end
if select >= 49 then
	select = 1;
end
if select <= 0 then
	select = 48;
end
if coefficient >= 2 then
	aira = false
	airc = false
	firea = false
	watera = false
	waterc = false
	grounda = false
	groundc = false
	booma = false
	icea = false
	hesa = false
	copecka = false
	deserta = false
	kya = false
	thunderconductora = false
	timea = false
	oceana = false
	economya = false
	iceberga = false
	metala = false
	sandwatcha = false
	silicona = false
	vinegara = false
	oldlampa = false
	lawlampa = false
	gasa = false
	cupa = false
	timea = false
	glassc = false
	thunderconductora = false
	deserta = false
	lampa = false
	lighta = false
	smokea = false
	ashesa = false
	steama = false
	lavaa = false
	spirita = false
	dusta = false
	winda = false
	firec = false
	pressurea = false
	energya = false
	seaa = false
	seac = false
	boga = false
	vodkaa = false
	stonea = false
	muda = false
	dirta = false
	storma = false
	volcanoa = false
	powdera = false
	electricitya = false
	geysera = false
	walla = false
	hpsa = false
	clouda = false
	sanda = false
	bacterya = false
	claya = false
	lifea = false
	beacha = false
	islanda = false
	bricka = false
	brickc = false
	boilera = false
	electroa = false
	sounda = false
	silicona = false
	walla = false
	peata = false
	dama = false
	cgwa = false
	glassa = false
	thundera = false
	hha = false
	ooa = false
	oooa = false
	firebiga = false
	coefficient = 0
end
 pge.gfx.enddrawing()
 pge.gfx.swapbuffers()
end
texture = nil