diff --git a/assets.lua b/assets.lua index e647600..45b022e 100644 --- a/assets.lua +++ b/assets.lua @@ -9,6 +9,7 @@ multilily = lily.loadMulti({ {lily.newImage, "assets/ships/excalibur-iv.png"}, {lily.newImage, "assets/ships/decorator.png"}, {lily.newImage, "assets/ships/particle.png"}, + {lily.newImage, "assets/particle.png"}, {lily.newImage, "assets/tiles/gf.png"} }) multilily:onComplete(function(_, lilies) @@ -22,8 +23,9 @@ multilily:onComplete(function(_, lilies) CaptainRobert.ship.image = lilies[8][1] CaptainJohn.ship.image = lilies[9][1] boosterParticle = lilies[10][1] + titleParticle = lilies[11][1] - tileGroundFull = lilies[11][1] + tileGroundFull = lilies[12][1] windowWidth = love.graphics.getWidth() windowHeight = love.graphics.getHeight() diff --git a/assets/particle.png b/assets/particle.png new file mode 100644 index 0000000..0f4597e Binary files /dev/null and b/assets/particle.png differ diff --git a/scene/title.lua b/scene/title.lua index 69ab083..9e38b14 100644 --- a/scene/title.lua +++ b/scene/title.lua @@ -14,15 +14,44 @@ function TitleScene:init() introSound:play() state = "in" + + pSystem = love.graphics.newParticleSystem(titleParticle,128) + pSystem:setParticleLifetime(0,0.8) + pSystem:setLinearAcceleration(-6,20,6,25) + pSystem:setSpeed(40,50) + pSystem:setRotation(10,20) + pSystem:setSpin(10,20) + pSystem:setRadialAcceleration(5,20) + pSystem:setTangentialAcceleration(10,20) + pSystem:setSizeVariation(0.5) + pSystem:setSizes(1,0.9,0.9,0.8,0.6,0.5,0.3,0.1) + pSystem:setColors( + 1,1,1,0.8, + 1,1,1,0.8, + 1,1,1,0.8, + 1,1,1,0.7, + 1,1,1,0.5, + 1,1,1,0.3, + 1,1,1,0.2, + 1,1,1,0.1 + ) + pSystem:setDirection(315*(math.pi/180)) + end function TitleScene:update(dt) + pSystem:update(dt) + if progressDelta < progressTarget then progressDelta = math.min( progressTarget, progressDelta + dt ) end percentage = (progressDelta/progressTarget) + if state == "wait" then + pSystem:emit( 32 ) + end + if state == "in" and progressDelta == progressTarget then state = "wait" progressDelta = 0 @@ -42,6 +71,8 @@ function TitleScene:update(dt) end if state == "complete" then + pSystem:stop() + pSystem = nil currentScene = GameScene currentScene:init() end @@ -60,7 +91,13 @@ function TitleScene:draw() end love.graphics.setColor(255,255,255, logoAlpha) + + if pSystem ~= nil then + love.graphics.draw(pSystem, ((windowWidth - logoWidth) / 2) + 300, logoYpos + 8) + end + love.graphics.draw(gameLogo, (windowWidth - logoWidth) / 2, logoYpos ) + end function TitleScene:drawHud()