fondo = {c=1} for i = 1, 3 do fondo[i] = image.load("imagenes/fondo"..i..".png") end sb = image.load("imagenes/SB2011.png") adivinanza = {img ={},current = 17} adivinanza.respuesta ={"mesa","jabon","puerta","iglesia","pincel","camposanto","radio","tunera","reloj","moneda","escoba","candado"} for i = 1, 255 do sb:blend(0,0,i) screen.flip() end for i = 17,28 do adivinanza.img[i] = image.load("imagenes/adivinanza"..i..".png") end for i = 255, 1,-1 do sb:blend(0,0,i) screen.flip() end function menu() while true do controls.read() fondo[fondo.c]:blit(0,0) if controls.press("down") then fondo.c = fondo.c +1 end if fondo.c > #fondo then fondo.c = 1 end if controls.press("up") then fondo.c = fondo.c -1 end if fondo.c < 1 then fondo.c = #fondo end screen.flip() if controls.press("cross") then if fondo.c == 1 then jugar() elseif fondo.c == 2 then os.message("Code: Pepingo el hacker\nGraficos de inicio: Deinouse\nAgradecimientos Especiales: Xerpi\nAgradecimientos por librerias: Rober Galarga") else os.exit() end end --if controls.select() then a() end end end function jugar() while true do controls.read() adivinanza.img[adivinanza.current]:blit(0,0) if controls.press("r") then adivinanza.current = math.min(28,adivinanza.current+1) end if controls.press("l") then adivinanza.current = math.max(17,adivinanza.current-1) end screen.flip() if controls.press("cross") then if string.lower(os.osk("Escribe una respuesta:","",100,10,0)) == adivinanza.respuesta[adivinanza.current-16] then os.message("Has acertado!!! Gracias por Jugar =D") adivinanza.current = adivinanza.current +1 if adivinanza.current > 28 then os.message("Te has pasado el juego!") adivinanza.current = 17 menu() end else os.message("Has fallado!!!! No pasas de Nivel :(") end end if controls.start() then menu() end end end menu()