소스 검색

Randomize splat pitch;

bjorn 10 년 전
부모
커밋
bba0b64b65
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      person.lua

+ 3 - 1
person.lua

@@ -80,7 +80,9 @@ function Person:collideWith(other)
 
   if select(2, self.body:getLinearVelocity()) > 500 and self.state == self.dead then
     if not self.splatted then
-      ctx.sound:play('splat')
+      ctx.sound:play('splat', function(sound)
+        sound:setPitch(.9 + love.math.random() * .2)
+      end)
       ctx.particles:emit('blood', self.body:getX(), self.body:getY(), 8)
       self.splatted = true
       if self.screamSound then