diff --git a/scripts/gameplay/track_end.lua b/scripts/gameplay/track_end.lua index 86d57b3..cd4f137 100644 --- a/scripts/gameplay/track_end.lua +++ b/scripts/gameplay/track_end.lua @@ -1,3 +1,4 @@ +local Easing = require('common.easings') local bgImage = gfx.CreateSkinImage("gameplay/track_end/bg.png", 0) local bgHexTopImage = gfx.CreateSkinImage("gameplay/track_end/top_hex.png", 0) @@ -8,14 +9,18 @@ local enterFlarePinkImage = gfx.CreateSkinImage("gameplay/track_end/flares/pink_ local trackCompImage = gfx.CreateSkinImage("gameplay/track_end/track_comp.png", 0) +local particleRedBall = gfx.CreateSkinImage("gameplay/track_end/particles/red_ball.png", 0) +local particleRedRing = gfx.CreateSkinImage("gameplay/track_end/particles/red_ring.png", 0) + local outroTransitionScale = 0; local outroTransitionGlobalAlpha = 0; local outroTransitionEnterFlareX = -1920; local outroTransitionTextCutX = 0; +local outroTransitionFlareRedX = -500; local tickTransitions = function (deltaTime) if outroTransitionScale < 1 then - outroTransitionScale = outroTransitionScale + deltaTime / 4 -- transition should last for that time in seconds + outroTransitionScale = outroTransitionScale + deltaTime / 15 -- transition should last for that time in seconds else outroTransitionScale = 1 end @@ -31,6 +36,36 @@ local tickTransitions = function (deltaTime) (outroTransitionScale-0.25)/0.2* -- Last from 0.25 transition scale for 0.2 transition scale, ending at 0.45 TS (1920) -- reveal this amount during the transition (the whole width) )-0); -- start from 0 + + outroTransitionFlareRedX = math.min(1080+150, ( + Easing.outQuad(math.min(1, + (outroTransitionScale-0.25)/0.2) -- Last from 0.25 transition scale for 0.2 transition scale, ending at 0.45 TS + )* + (1080+150) -- reveal this amount during the transition (the whole width) + )-500); -- start from -500 (off-screen) +end + +local drawParticles = function () + gfx.BeginPath(); + gfx.ImageRect( + outroTransitionFlareRedX, + 510, + 787*0.5, + 818*0.5, + particleRedBall, + 1, + 0 + ); + gfx.BeginPath(); + gfx.ImageRect( + outroTransitionFlareRedX, + 510, + 787*0.5, + 818*0.5, + particleRedRing, + 1, + 0 + ); end local render = function (deltaTime) @@ -91,6 +126,8 @@ local render = function (deltaTime) 0 ); + drawParticles(); + gfx.BeginPath(); gfx.Scissor(0, 530, outroTransitionTextCutX, 1920) gfx.ImageRect( diff --git a/textures/gameplay/track_end/flares/red_glow_ball.png b/textures/gameplay/track_end/particles/red_ball.png similarity index 100% rename from textures/gameplay/track_end/flares/red_glow_ball.png rename to textures/gameplay/track_end/particles/red_ball.png diff --git a/textures/gameplay/track_end/flares/red_flare_ring.png b/textures/gameplay/track_end/particles/red_ring.png similarity index 100% rename from textures/gameplay/track_end/flares/red_flare_ring.png rename to textures/gameplay/track_end/particles/red_ring.png