-- Top Down Racing
-- Beta 0.1
-- Code and graphics by Killerfeeshy




System.usbDiskModeActivate()
System.setCpuSpeed(333)

splash = Image.load("IMAGES/splash.png")
splash2 = Image.load("IMAGES/splash2.png")
fader = Image.createEmpty(480,272)
alphaValue = 255
faderColor = Color.new(0,0,0,alphaValue)
fader:clear(faderColor)

while true do
screen:clear()
screen:blit(0,0,splash)
screen:blit(0,0,fader)
if alphaValue > 0 then
alphaValue = alphaValue - 5
else
break
end
faderColor = Color.new(0,0,0,alphaValue)
fader:clear(faderColor)
screen.waitVblankStart()
screen.flip()
end
screen.waitVblankStart(100)
while true do
screen:clear()
screen:blit(0,0,splash)
screen:blit(0,0,fader)
if alphaValue < 255 then
alphaValue = alphaValue + 5
else
break
end
faderColor = Color.new(0,0,0,alphaValue)
fader:clear(faderColor)
screen.waitVblankStart()
screen.flip()
end


--SPLASH 2--

while true do
screen:clear()
screen:blit(0,0,splash2)
screen:blit(0,0,fader)
if alphaValue > 0 then
alphaValue = alphaValue - 5
else
break
end
faderColor = Color.new(0,0,0,alphaValue)
fader:clear(faderColor)
screen.waitVblankStart()
screen.flip()
end
screen.waitVblankStart(100)
while true do
screen:clear()
screen:blit(0,0,splash2)
screen:blit(0,0,fader)
if alphaValue < 255 then
alphaValue = alphaValue + 5
else
break
end
faderColor = Color.new(0,0,0,alphaValue)
fader:clear(faderColor)
screen.waitVblankStart()
screen.flip()
end


while true do
dofile("FILES/mainmenu.lua")
end
