소스 검색

Improve whirr;

bjorn 10 년 전
부모
커밋
6016e25414
1개의 변경된 파일10개의 추가작업 그리고 2개의 파일을 삭제
  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)