
dofile("animlib.lua")
naves = {}
naves[1]=image.load("spacecraft/nave1.png")
naves[2]=image.load("spacecraft/nave2.png")
naves[3]=image.load("spacecraft/nave3.png")
naves[4]=image.load("spacecraft/nave4.png")
naves[5]=image.load("spacecraft/nave5.png")

menu1 = image.load("select/1.png")
menu2 = image.load("select/2.png")
menu3 = image.load("select/3.png")
menu4 = image.load("select/4.png")
menu5 = image.load("select/5.png")
animacion5=anim.create(naves[5],47,46,200)
animacion5:start()
animacion4=anim.create(naves[4],47,46,200)
animacion4:start()
animacion3=anim.create(naves[3],47,46,200)
animacion3:start()
animacion2=anim.create(naves[2],47,46,200)
animacion2:start()
animacion = anim.create(naves[1],47,46,200)
animacion:start()
current = 1
while true do
controls.read()
menu1:blit(0,0) 

if current == 1 then
menu1:blit(0,0)
if controls.press("cross") then
ini.read("select.ini","selector")
ini.write("select.ini","selector ","1")

dofile("game.lua")
end

elseif current == 2 then
menu2:blit(0,0)
if controls.press("cross") then
ini.read("select.ini","selector")
ini.write("select.ini","selector "," 2")

dofile("game.lua")
end

elseif current == 3 then
menu3:blit(0,0)
if controls.press("cross") then

ini.read("select.ini","selector")
ini.write("select.ini","selector "," 3")

dofile("game.lua")
end

elseif current == 4 then
menu4:blit(0,0)
if controls.press("cross") then

ini.read("select.ini","selector")
ini.write("select.ini","selector "," 4")

dofile("game.lua")
end

elseif current == 5 then
menu5:blit(0,0)
if controls.press("cross") then
ini.read("select.ini","selector")
ini.write("select.ini","selector "," 5")

dofile("game.lua")
end
end
if controls.press("left") and current > 1 then
	current = current - 1
elseif controls.press("right") and current < 5 then
	current = current + 1
end
anim.blit(animacion,36,73)
anim.blit(animacion2,144,73)
anim.blit(animacion3,254,73)
anim.blit(animacion4,364,73)
anim.blit(animacion5,192,187)
screen.flip()
end