primo = Image.load("primo.png")
primor = Image.load("primor.png")
wall = Image.load("wall.png")
cat0 = Image.load("cat0.png")
cat0a = Image.load("cat0.png")
cat1 = Image.load("cat1.png")
cat2 = Image.load("cat2.png")
secondo = Image.load("secondo.png")
secondor = Image.load("secondo.png")

sgreen = Color.new(164,194,106);
Ogg.load("naturesounds.ogg") 
Ogg.init(1)

x1 = 0 
x2 = 0
x3 = 0
x1z = 480 
x2z = 480 
x3z = 480 
timec = 0

y1 = 0
y2 = 165
y3 = 0
xtuttib = 480

function Movement()
x1 = x1 - 3
x2 = x2 - 2
x3 = x3 - .5
end
function Cloudess()
if x1 <= 0 then
x1z = x1z - 1
end
end
function Cloudess()
x1z = x1z - 3
x2z = x2z - 2
x3z = x3z - .5
if x1 < -480 then
x1 = 480
elseif x1z < -480 then
x1z = 480
elseif x2 < -480 then
x2 = 480
elseif x2z < -480 then
x2z = 480
elseif x3 < -480 then
x3 = 480
elseif x3z < -480 then
x3z = 480
end
end

function CAT()
timec = timec + 1
if timec == 10 then 
cat0 = cat0a
elseif timec == 15 then
cat0 = cat1
elseif timec == 25 then
cat0 = cat2
end
if timec >= 30 then
timec = 0
end
end

while true do
padmenu = Controls.read()
Movement()
Cloudess()
CAT()
System.usbDiskModeActivate() 

Ogg.play()
screen:clear(sgreen)
screen:blit(0 , 0, wall)
screen:blit(x1 , y1 , primo)
screen:blit(x1z , y1 , primor)
screen:blit(200 , 150 , cat0)
screen:blit(x2 , y2 , secondo)
screen:blit(x2z , y2 , secondor)

cat0:pixel(10 , 10)
screen.waitVblankStart()
screen.flip()

end
