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

stage1load = loadfile("./Script/Facil/Niveis/Stage1/Stage1.lua")
stage4load = loadfile("./Script/Facil/Niveis/Stage4/Stage4.lua") 
	
while true do
screen:clear()
currentTime = intro:time()

if plife == 0 then
screen:print(200,110,"Dont Give Up!",white)
screen:print(390,240,"Loading...",white)
end
if Enemymiddle.life == 0 then
screen:print(180,110,"You are almost there!",white)
screen:print(390,240,"Loading...",white)
end
		
if currentTime > 4000 and Enemymiddle.life == 0 then
System.memclean()
stage4load()
System.memclean()
end

if currentTime > 4000 and plife == 0 then
System.memclean()
stage1load()
System.memclean()
end

screen.waitVblankStart()
screen.flip()
end 

System.memclean()
stage1 = nil
stage2 = nil
stage3 = nil
backmiddle = nil
s = nil
ss1 = nil
ss2 = nil
ss3 = nil
ss8 = nil
ss9 = nil
ss10 = nil
ss11 = nil
ss12 = nil
ss13 = nil
ss19 = nil
Enemylefttable = nil
Enemyrighttable = nil
Enemystandtable = nil
collectgarbage(collect)
System.memclean()