ivanguerr
December 19th, 2005, 11:20
I´m trying to slide two images, one from left to right and the other one from right to left. When both images dissapear from screen I load another two images.
The problem is when I´ve loaded 5 or 6 images, lua shows the "load error image". I tryed to change the image, the path, also checked the correct filename and path.
The program works fine in the lua player windows version. What´s wrong?
The follow table WORKS because it only has 3 images per table. If I try to insert 4 images in every table the program crashes.The other new images are good files because if I put them alone in the table, they work (I also convert them into png files).
animacion1 = {a1=Image.load("imagen/foto00.jpg"),a2=Image.load("imagen/foto02.jpg"),a3=Image.load("imagen/foto04.jpg")}
animacion2 = {b1=Image.load("imagen/foto01.jpg"),b2=Image.load("imagen/foto03.jpg"),b3=Image.load("imagen/foto05.jpg")}
x1=-150
x2=480
cont=0
animacionxx=animacion1.a1
animacionyy=animacion2.b1
while true do
screen:blit(0, 0, fondo)
screen:blit(x1, 100, animacionxx)
screen:blit(x2, 25, animacionyy)
x1=x1 + 1
if x1 == 480 then
x1=-150
cont=cont+1
if cont == 1 then
animacionxx=animacion1.a2
elseif cont== 2 then
animacionxx=animacion1.a3
elseif cont== 3 then
animacionxx=animacion1.a1
end
end
x2=x2 - 1
if x2 == -150 then
x2=480
if cont == 1 then
animacionyy=animacion2.b2
elseif cont== 2 then
animacionyy=animacion2.b3
elseif cont== 3 then
cont=0
animacionyy=animacion2.b1
end
end
screen.waitVblankStart()
screen.flip()
pad=Controls.read()
if pad:start() then
break
end
end
The problem is when I´ve loaded 5 or 6 images, lua shows the "load error image". I tryed to change the image, the path, also checked the correct filename and path.
The program works fine in the lua player windows version. What´s wrong?
The follow table WORKS because it only has 3 images per table. If I try to insert 4 images in every table the program crashes.The other new images are good files because if I put them alone in the table, they work (I also convert them into png files).
animacion1 = {a1=Image.load("imagen/foto00.jpg"),a2=Image.load("imagen/foto02.jpg"),a3=Image.load("imagen/foto04.jpg")}
animacion2 = {b1=Image.load("imagen/foto01.jpg"),b2=Image.load("imagen/foto03.jpg"),b3=Image.load("imagen/foto05.jpg")}
x1=-150
x2=480
cont=0
animacionxx=animacion1.a1
animacionyy=animacion2.b1
while true do
screen:blit(0, 0, fondo)
screen:blit(x1, 100, animacionxx)
screen:blit(x2, 25, animacionyy)
x1=x1 + 1
if x1 == 480 then
x1=-150
cont=cont+1
if cont == 1 then
animacionxx=animacion1.a2
elseif cont== 2 then
animacionxx=animacion1.a3
elseif cont== 3 then
animacionxx=animacion1.a1
end
end
x2=x2 - 1
if x2 == -150 then
x2=480
if cont == 1 then
animacionyy=animacion2.b2
elseif cont== 2 then
animacionyy=animacion2.b3
elseif cont== 3 then
cont=0
animacionyy=animacion2.b1
end
end
screen.waitVblankStart()
screen.flip()
pad=Controls.read()
if pad:start() then
break
end
end