+ start with track end transition
|
@ -11,6 +11,8 @@ local Gauge = require('gameplay.gauge')
|
||||||
local Chain = require('gameplay.chain')
|
local Chain = require('gameplay.chain')
|
||||||
local LaserAlert = require('gameplay.laser_alert')
|
local LaserAlert = require('gameplay.laser_alert')
|
||||||
|
|
||||||
|
local TrackEnd = require('gameplay.track_end')
|
||||||
|
|
||||||
local resx, resy = game.GetResolution()
|
local resx, resy = game.GetResolution()
|
||||||
local desw, desh;
|
local desw, desh;
|
||||||
local scale;
|
local scale;
|
||||||
|
@ -60,8 +62,12 @@ function render_intro(deltaTime)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local outroTimer = 0;
|
||||||
function render_outro(deltaTime, clearState)
|
function render_outro(deltaTime, clearState)
|
||||||
return true, 1
|
TrackEnd.render(deltaTime);
|
||||||
|
|
||||||
|
outroTimer = outroTimer + deltaTime
|
||||||
|
return outroTimer > 10, 1 - outroTimer
|
||||||
end
|
end
|
||||||
|
|
||||||
function update_score(newScore)
|
function update_score(newScore)
|
||||||
|
|
|
@ -0,0 +1,104 @@
|
||||||
|
|
||||||
|
local bgImage = gfx.CreateSkinImage("gameplay/track_end/bg.png", 0)
|
||||||
|
local bgHexTopImage = gfx.CreateSkinImage("gameplay/track_end/top_hex.png", 0)
|
||||||
|
local bgHexBottomImage = gfx.CreateSkinImage("gameplay/track_end/bottom_hex.png", 0)
|
||||||
|
|
||||||
|
local enterFlareBlueImage = gfx.CreateSkinImage("gameplay/track_end/flares/blue_transition_flare.png", 0)
|
||||||
|
local enterFlarePinkImage = gfx.CreateSkinImage("gameplay/track_end/flares/pink_transition_flare.png", 0)
|
||||||
|
|
||||||
|
local outroTransitionScale = 0;
|
||||||
|
local outroTransitionGlobalAlpha = 0;
|
||||||
|
local outroTransitionEnterFlareX = -1920;
|
||||||
|
|
||||||
|
local tickTransitions = function (deltaTime)
|
||||||
|
if outroTransitionScale < 1 then
|
||||||
|
outroTransitionScale = outroTransitionScale + deltaTime / 3 -- transition should last for that time in seconds
|
||||||
|
else
|
||||||
|
outroTransitionScale = 1
|
||||||
|
end
|
||||||
|
|
||||||
|
outroTransitionGlobalAlpha = math.min(1, (outroTransitionScale*6))
|
||||||
|
|
||||||
|
outroTransitionEnterFlareX = math.min(2*1920, (
|
||||||
|
(outroTransitionScale-0.2)/0.1* -- Last from 0.2 transition scale for 0.1 transition scale, ending at 0.3 TS
|
||||||
|
(1920*2) -- move this amount during the transition
|
||||||
|
)-1920); -- start off-screen
|
||||||
|
end
|
||||||
|
|
||||||
|
local render = function (deltaTime)
|
||||||
|
tickTransitions(deltaTime);
|
||||||
|
gfx.GlobalAlpha(outroTransitionGlobalAlpha);
|
||||||
|
|
||||||
|
gfx.BeginPath();
|
||||||
|
gfx.ImageRect(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
2160*0.5,
|
||||||
|
3840*0.5,
|
||||||
|
bgImage,
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
);
|
||||||
|
|
||||||
|
gfx.BeginPath();
|
||||||
|
gfx.ImageRect(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
2160*0.5,
|
||||||
|
1921*0.5,
|
||||||
|
bgHexTopImage,
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
);
|
||||||
|
gfx.BeginPath();
|
||||||
|
gfx.ImageRect(
|
||||||
|
0,
|
||||||
|
1920-(1921*0.5),
|
||||||
|
2160*0.5,
|
||||||
|
1921*0.5,
|
||||||
|
bgHexBottomImage,
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
);
|
||||||
|
|
||||||
|
-- Enter flares
|
||||||
|
gfx.BeginPath();
|
||||||
|
gfx.ImageRect(
|
||||||
|
outroTransitionEnterFlareX,
|
||||||
|
530,
|
||||||
|
3280*0.5,
|
||||||
|
790*0.5,
|
||||||
|
enterFlareBlueImage,
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
);
|
||||||
|
gfx.BeginPath();
|
||||||
|
gfx.ImageRect(
|
||||||
|
-outroTransitionEnterFlareX, -- go from the other side of the screen
|
||||||
|
530,
|
||||||
|
3280*0.5,
|
||||||
|
790*0.5,
|
||||||
|
enterFlarePinkImage,
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
);
|
||||||
|
|
||||||
|
-- Get the banner downscaled in whatever resolution it is, while maintaining the aspect ratio
|
||||||
|
-- local tw,th = gfx.ImageSize(bannerBaseImage);
|
||||||
|
-- BANNER_H = th * (1080/tw);
|
||||||
|
|
||||||
|
-- gfx.BeginPath();
|
||||||
|
-- gfx.ImageRect(
|
||||||
|
-- 0,
|
||||||
|
-- 0,
|
||||||
|
-- BANNER_W,
|
||||||
|
-- BANNER_H,
|
||||||
|
-- bannerBaseImage,
|
||||||
|
-- 1,
|
||||||
|
-- 0
|
||||||
|
-- );
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
render=render
|
||||||
|
}
|
Before Width: | Height: | Size: 890 KiB After Width: | Height: | Size: 890 KiB |
Before Width: | Height: | Size: 411 KiB After Width: | Height: | Size: 411 KiB |
Before Width: | Height: | Size: 251 KiB After Width: | Height: | Size: 251 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 264 KiB After Width: | Height: | Size: 264 KiB |
Before Width: | Height: | Size: 998 KiB After Width: | Height: | Size: 998 KiB |
Before Width: | Height: | Size: 518 KiB After Width: | Height: | Size: 518 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 917 KiB After Width: | Height: | Size: 917 KiB |
Before Width: | Height: | Size: 234 KiB After Width: | Height: | Size: 234 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 425 KiB After Width: | Height: | Size: 425 KiB |
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 92 KiB |
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 135 KiB |