Explorar o código

Improve whirr;

bjorn %!s(int64=10) %!d(string=hai) anos
pai
achega
6016e25414
Modificáronse 1 ficheiros con 10 adicións e 2 borrados
  1. 10 2
      pigeon.lua

+ 10 - 2
pigeon.lua

@@ -75,7 +75,11 @@ function Pigeon:init()
         self.rightWhirr:stop()
       end
 
-      self.leftWhirr = ctx.sound:play('whirr')
+      self.leftWhirr = ctx.sound:play('whirr', function(sound)
+        sound:setVolume(.35)
+        sound:setPitch(.95 + love.math.random(.1))
+      end)
+
       ctx.sound:play('impact', function(sound)
         sound:setVolume(.5)
       end)
@@ -98,7 +102,11 @@ function Pigeon:init()
         self.leftWhirr:stop()
       end
 
-      self.rightWhirr = ctx.sound:play('whirr')
+      self.rightWhirr = ctx.sound:play('whirr', function(sound)
+        sound:setVolume(.35)
+        sound:setPitch(.95 + love.math.random(.1))
+      end)
+
       ctx.sound:play('impact', function(sound)
         sound:setVolume(.5)
       end)