2
0
bjorn 10 жил өмнө
parent
commit
6a33267b77

BIN
media/sounds/disco.ogg


+ 7 - 0
pigeon.lua

@@ -136,6 +136,7 @@ function Pigeon:init()
   self.drop = nil
   self.drop = nil
   self.downDirty = 0
   self.downDirty = 0
   self.crushGrace = 0
   self.crushGrace = 0
+  self.rainbowShitSound = nil
 
 
   self:initBeak()
   self:initBeak()
   self:initFeet()
   self:initFeet()
@@ -154,6 +155,8 @@ function Pigeon:update()
 
 
   --self.animation.scale = self.rainbowShitTimer > 0 and 1 or .7
   --self.animation.scale = self.rainbowShitTimer > 0 and 1 or .7
   self.rainbowShitTimer = timer.rot(self.rainbowShitTimer, function()
   self.rainbowShitTimer = timer.rot(self.rainbowShitTimer, function()
+    ctx.backgroundSound:resume()
+    self.rainbowShitSound:stop()
     flux.to(self.animation, .2, {scale = .7}, 'elasticout')
     flux.to(self.animation, .2, {scale = .7}, 'elasticout')
   end)
   end)
 
 
@@ -408,6 +411,10 @@ end
 
 
 function Pigeon:activateRainbowShit()
 function Pigeon:activateRainbowShit()
   self.rainbowShitTimer = self.rainbowShitTimer + 5
   self.rainbowShitTimer = self.rainbowShitTimer + 5
+  ctx.backgroundSound:pause()
+  self.rainbowShitSound = ctx.sound:loop('disco', function(sound)
+    sound:setVolume(.5)
+  end)
   flux.to(self.animation, .2, {scale = 1}, 'elasticout')
   flux.to(self.animation, .2, {scale = 1}, 'elasticout')
 end
 end