bjorn 10 years ago
parent
commit
7f8b51e63b
5 changed files with 38 additions and 0 deletions
  1. 17 0
      data/particle/blood.lua
  2. BIN
      media/sounds/scream10.ogg
  3. BIN
      media/sounds/scream11.ogg
  4. BIN
      media/sounds/scream9.ogg
  5. 21 0
      person.lua

+ 17 - 0
data/particle/blood.lua

@@ -0,0 +1,17 @@
+local Blood = class()
+Blood.image = data.media.graphics.particles.softCircle
+Blood.max = 1024
+Blood.blendMode = 'alpha'
+
+Blood.options = {}
+Blood.options.particleLifetime = {1}
+Blood.options.colors = {{220, 0, 0, 100}}
+Blood.options.sizes = {.3}
+Blood.options.sizeVariation = .5
+Blood.options.areaSpread = {'normal', 4, 4}
+Blood.options.direction = -math.pi / 2
+Blood.options.spread = math.pi / 4
+Blood.options.speed = {500, 800}
+Blood.options.linearAcceleration = {0, 1500, 0, 2000}
+
+return Blood

BIN
media/sounds/scream10.ogg


BIN
media/sounds/scream11.ogg


BIN
media/sounds/scream9.ogg


+ 21 - 0
person.lua

@@ -81,6 +81,7 @@ function Person:collideWith(other)
   if select(2, self.body:getLinearVelocity()) > 500 then
     if not self.splatted then
       ctx.sound:play('splat')
+      ctx.particles:emit('blood', self.body:getX(), self.body:getY(), 8)
       self.splatted = true
       if self.screamSound then
         self.screamSound:stop()
@@ -174,7 +175,27 @@ function Person.dead:enter()
       sound:setPitch(.9 + love.math.random() * .2)
     end)
     self.screamed = true
+  elseif love.math.random() < .3 and self.gender == 'male' then
+    self.screamSound = ctx.sound:play('scream9', function(sound)
+      sound:setVolume(.75)
+      sound:setPitch(.9 + love.math.random() * .2)
+    end)
+    self.screamed = true
+  elseif love.math.random() < .01 and self.gender == 'male' then
+    self.screamSound = ctx.sound:play('scream10', function(sound)
+      sound:setVolume(1)
+      sound:setPitch(.9 + love.math.random() * .2)
+    end)
+    self.screamed = true
+  elseif love.math.random() < .3 and self.gender == 'male' then
+    self.screamSound = ctx.sound:play('scream11', function(sound)
+      sound:setVolume(.75)
+      sound:setPitch(.9 + love.math.random() * .2)
+    end)
+    self.screamed = true
   end
+
+  ctx.particles:emit('blood', self.body:getX(), self.body:getY(), 4)
 end
 
 function Person.dead:update()