ExperimentalGear/scripts/titlescreen/splash.lua

32 lines
705 B
Lua

local splash1Image = gfx.CreateSkinImage('titlescreen/splash/splash1.png', 0);
local splashTimer = 5;
game.LoadSkinSample('titlescreen/splash/splash1.wav');
local splash1SfxPlayed = false;
render = function (deltaTime)
gfx.BeginPath();
gfx.ImageRect(0, 0, 1080, 1920, splash1Image, 1, 0);
splashTimer = splashTimer - deltaTime
if (not splash1SfxPlayed) then
splash1SfxPlayed = true;
game.PlaySample('titlescreen/splash/splash1.wav');
end
if (splashTimer < 0) then
splash1SfxPlayed = false;
splashTimer = 5;
return {
eventType = 'switch',
toScreen = 'title'
}
end
end
return {
render = render
}