System.memclean()
Image1 = Image.load("Images/credits.png")
Image2 = Image.load("Images/credits2.png")
battery1 = Image.load("images/battery4.png")
battery2 = Image.load("images/battery3.png")
battery3 = Image.load("images/battery2.png")
battery4 = Image.load("images/battery1.png")

function Nil_Pictures()
Image1 = nil
Image2 = nil
battery1 = nil
battery2 = nil
battery3 = nil
battery4 = nil
end

minuteur = Timer.new()
minuteur:start()

while true do
screen:clear()
pad = Controls.read()

currentTime = minuteur:time()

if currentTime < 450 then
screen:blit (0,0,Image1)
end
 
if currentTime > 450 then
screen:blit(0,0,Image2)
end
 
if currentTime > 525 then
minuteur:stop()
minuteur:reset(0)
minuteur:start()
end

--BATERIE>>>
if System.powerGetBatteryLifePercent() >= 0 then batteryL = battery1 end
if System.powerGetBatteryLifePercent() > 30 then batteryL = battery2 end
if System.powerGetBatteryLifePercent() > 50 then batteryL = battery3 end
if System.powerGetBatteryLifePercent() > 70 then batteryL = battery4 end
-------------
screen:blit(4,3,batteryL)

if pad:square() then
Nil_Pictures()
dofile("Scripts/menu.lua")
end

screen.waitVblankStart()
screen.flip()
end