From ce407e6adfb8791145d3857beb44fcd9e9f57f17 Mon Sep 17 00:00:00 2001 From: FajsiEx Date: Wed, 17 Nov 2021 18:56:51 +0100 Subject: [PATCH] + new particle ssytem & + green dot 1 and 2, blue ring, large rainbow ring and red ball particles back --- scripts/gameplay/track_end.lua | 265 +++++++++++------- .../green_dot_1.png} | Bin .../green_dot_2.png} | Bin 3 files changed, 162 insertions(+), 103 deletions(-) rename textures/gameplay/track_end/{flares/green_dot_2.png => particles/green_dot_1.png} (100%) rename textures/gameplay/track_end/{flares/green_dot_1.png => particles/green_dot_2.png} (100%) diff --git a/scripts/gameplay/track_end.lua b/scripts/gameplay/track_end.lua index b239d70..9e30b8e 100644 --- a/scripts/gameplay/track_end.lua +++ b/scripts/gameplay/track_end.lua @@ -10,14 +10,14 @@ local enterFlarePinkImage = gfx.CreateSkinImage("gameplay/track_end/flares/pink_ local trackCompImage = gfx.CreateSkinImage("gameplay/track_end/track_comp.png", 0) local trackCompBlurImage = gfx.CreateSkinImage("gameplay/track_end/track_comp_blur.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 particleYellowRing = gfx.CreateSkinImage("gameplay/track_end/particles/yellow_ring.png", 0) +-- new +local particleGreenDot1Image = gfx.CreateSkinImage("gameplay/track_end/particles/green_dot_1.png", 0) +local particleGreenDot2Image = gfx.CreateSkinImage("gameplay/track_end/particles/green_dot_2.png", 0) -local particleSmallRainbowRing = gfx.CreateSkinImage("gameplay/track_end/particles/small_rainbow_ring.png", 0) -local particleSmYellowRingA = gfx.CreateSkinImage("gameplay/track_end/particles/small_yellow_ring_1.png", 0) -local particleSmYellowRingB = gfx.CreateSkinImage("gameplay/track_end/particles/small_yellow_ring_2.png", 0) -local particleSmYellowRingC = gfx.CreateSkinImage("gameplay/track_end/particles/small_yellow_ring_4.png", 0) +local particleBlueRingImage = gfx.CreateSkinImage("gameplay/track_end/particles/blue_ring.png", 0) +local particleLargeRainbowRingImage = gfx.CreateSkinImage("gameplay/track_end/particles/large_rainbow_ring.png", 0) + +local particleRedBallImage = gfx.CreateSkinImage("gameplay/track_end/particles/red_ball.png", 0) local outroTransitionScale = 0; @@ -28,12 +28,64 @@ local outroTransitionTextCutX = 0; local outroTransitionTextAlpha = 1; local outroTransitionTextBlurAlpha = 0; -local outroTransitionParticleRedX = -500; +local particles = { + green_dot_one = { + texture = particleGreenDot1Image, + startX = 1280, + finishX = 380, + currentX = 1280, + yPos = 660, + width = 235*0.5, + height = 235*0.5, + startTime = 0.25, + duration = 0.6 + }, + green_dot_two = { + texture = particleGreenDot2Image, + startX = 1280, + finishX = 70, + currentX = 1280, + yPos = 610, + width = 128*0.5, + height = 128*0.5, + startTime = 0.25, + duration = 0.6 + }, + blue_ring = { + texture = particleBlueRingImage, + startX = 1280, + finishX = 65, + currentX = 1280, + yPos = 620, + width = 229*0.5, + height = 229*0.5, + startTime = 0.25, + duration = 0.6 + }, + large_rainbow_ring = { -- needs opacity and scale transitions + texture = particleLargeRainbowRingImage, + startX = (1080/2-(2160*0.675)/2), + finishX = (1080/2-(2160*0.675)/2), + currentX = (1080/2-(2160*0.675)/2), + yPos = (680-(2273*0.675)/2) + 100, + width = 2160*0.675, + height = 2273*0.675, + startTime = 0.25, + duration = 0.6 + }, + red_ball = { -- needs opacity transition + texture = particleRedBallImage, + startX = -150, + finishX = -150, + currentX = -150, + yPos = 500, + width = 787*0.5, + height = 818*0.5, + startTime = 0.25, + duration = 0.6 + }, +} -local outroTransitionParticleSmallRainbowX = 1080; -local outroTransitionParticleSmallYellowRingAX = 1080; -local outroTransitionParticleSmallYellowRingBX = 1080; -local outroTransitionParticleSmallYellowRingCX = 1080; if (game.GetSkinSetting('audio_systemVoice')) then game.LoadSkinSample('gameplay/track_comp_rasis.wav'); @@ -66,27 +118,20 @@ 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 ) - outroTransitionParticleRedX = math.min(1080+150, ( - particleTransitionScale* - (1080+150) - )-500); + for particleName, particle in pairs(particles) do + if (outroTransitionScale < particle.startTime) then + particle.currentX = particle.startX; + elseif (outroTransitionScale >= particle.startTime + particle.duration) then + particle.currentX = particle.finishX; + else + local transScale = Easing.outQuad(math.min(1, (outroTransitionScale-particle.startTime)/particle.duration)); - outroTransitionParticleSmallRainbowX = math.max(-1080-250, ( - particleTransitionScale* - (-1080-250) - )+1080); - outroTransitionParticleSmallYellowRingAX = math.max(-1080+0, ( - particleTransitionScale* - (-1080+0) - )+1080); - outroTransitionParticleSmallYellowRingBX = math.max(-1080+250, ( - particleTransitionScale* - (-1080+250) - )+1080); - outroTransitionParticleSmallYellowRingCX = math.max(-1080+200, ( - particleTransitionScale* - (-1080+200) - )+1080); + local xDiff = particle.finishX - particle.startX; + particle.currentX = particle.startX + xDiff*transScale; + end + end + + -- if (outroTransitionScale > 0.45 and outroTransitionScale < 0.5) then -- if (outroTransitionScale <= 0.475) then @@ -100,78 +145,92 @@ local tickTransitions = function (deltaTime) end local drawParticles = function () - gfx.BeginPath(); - gfx.ImageRect( - outroTransitionParticleRedX-80, - 510-80, - 787*0.7, - 818*0.7, - particleYellowRing, - 1, - 0 - ); - gfx.BeginPath(); - gfx.ImageRect( - outroTransitionParticleRedX, - 510, - 787*0.5, - 818*0.5, - particleRedBall, - 1, - 0 - ); - gfx.BeginPath(); - gfx.ImageRect( - outroTransitionParticleRedX, - 510, - 787*0.5, - 818*0.5, - particleRedRing, - 1, - 0 - ); + for particleName, particle in pairs(particles) do + gfx.BeginPath(); + gfx.ImageRect( + particle.currentX, + particle.yPos, + particle.width, + particle.height, + particle.texture, + 1, + 0 + ); + -- game.Log(particle.currentX, game.LOGGER_ERROR) + end - -- Right side - gfx.BeginPath(); - gfx.ImageRect( - outroTransitionParticleSmallRainbowX, - 465, - 1117*0.5, - 1117*0.5, - particleSmallRainbowRing, - 1, - 0 - ); - gfx.BeginPath(); - gfx.ImageRect( - outroTransitionParticleSmallYellowRingAX, - 575, - 579*0.5, - 557*0.5, - particleSmYellowRingA, - 1, - 0 - ); - gfx.BeginPath(); - gfx.ImageRect( - outroTransitionParticleSmallYellowRingBX, - 585, - 436*0.5, - 392*0.5, - particleSmYellowRingB, - 1, - 0 - ); - gfx.BeginPath(); - gfx.ImageRect( - outroTransitionParticleSmallYellowRingCX, - 625, - 275*0.5, - 275*0.5, - particleSmYellowRingC, - 1, - 0 - ); + -- gfx.BeginPath(); + -- gfx.ImageRect( + -- outroTransitionParticleRedX-80, + -- 510-80, + -- 787*0.7, + -- 818*0.7, + -- particleYellowRing, + -- 1, + -- 0 + -- ); + -- gfx.BeginPath(); + -- gfx.ImageRect( + -- outroTransitionParticleRedX, + -- 510, + -- 787*0.5, + -- 818*0.5, + -- particleRedBall, + -- 1, + -- 0 + -- ); + -- gfx.BeginPath(); + -- gfx.ImageRect( + -- outroTransitionParticleRedX, + -- 510, + -- 787*0.5, + -- 818*0.5, + -- particleRedRing, + -- 1, + -- 0 + -- ); + + -- -- Right side + -- gfx.BeginPath(); + -- gfx.ImageRect( + -- outroTransitionParticleSmallRainbowX, + -- 465, + -- 1117*0.5, + -- 1117*0.5, + -- particleSmallRainbowRing, + -- 1, + -- 0 + -- ); + -- gfx.BeginPath(); + -- gfx.ImageRect( + -- outroTransitionParticleSmallYellowRingAX, + -- 575, + -- 579*0.5, + -- 557*0.5, + -- particleSmYellowRingA, + -- 1, + -- 0 + -- ); + -- gfx.BeginPath(); + -- gfx.ImageRect( + -- outroTransitionParticleSmallYellowRingBX, + -- 585, + -- 436*0.5, + -- 392*0.5, + -- particleSmYellowRingB, + -- 1, + -- 0 + -- ); + -- gfx.BeginPath(); + -- gfx.ImageRect( + -- outroTransitionParticleSmallYellowRingCX, + -- 625, + -- 275*0.5, + -- 275*0.5, + -- particleSmYellowRingC, + -- 1, + -- 0 + -- ); end local handleSounds = function () diff --git a/textures/gameplay/track_end/flares/green_dot_2.png b/textures/gameplay/track_end/particles/green_dot_1.png similarity index 100% rename from textures/gameplay/track_end/flares/green_dot_2.png rename to textures/gameplay/track_end/particles/green_dot_1.png diff --git a/textures/gameplay/track_end/flares/green_dot_1.png b/textures/gameplay/track_end/particles/green_dot_2.png similarity index 100% rename from textures/gameplay/track_end/flares/green_dot_1.png rename to textures/gameplay/track_end/particles/green_dot_2.png