aboutsummaryrefslogtreecommitdiff
path: root/virus1.lua
diff options
context:
space:
mode:
author1029chris <1029chris@gmail.com>2016-10-29 23:23:11 -0700
committer1029chris <1029chris@gmail.com>2016-10-29 23:23:11 -0700
commit9766801068cbbf0910c427bfc258681b89615e14 (patch)
treefdeadf4ff6615d5d41736e6edaf5fe49b808b09a /virus1.lua
parentc1c74810562915bf45e74cbef174d6caf13b0db2 (diff)
Added speaking sounds to both viruses
Diffstat (limited to 'virus1.lua')
-rw-r--r--virus1.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/virus1.lua b/virus1.lua
index 11aa902..7dd3d30 100644
--- a/virus1.lua
+++ b/virus1.lua
@@ -242,6 +242,16 @@ function drawVirusFight1()
if string.len(v1.msgs[v1.c.chat.msgs]) ~= string.len(v1.c.chat.msg) then
v1.c.chat.char = v1.c.chat.char + v1.c.chat.sp*(60/love.timer.getFPS())
v1.c.chat.msg = string.sub(v1.msgs[v1.c.chat.msgs], 1, math.floor(v1.c.chat.char))
+ if math.floor(v1.c.chat.char) ~= math.floor(v1.prevChar) then
+ v1.voice:setPitch(math.random(8,12)/10)
+ v1.voice:setVolume(1)
+ if v1.voice:isPlaying() == true then
+ v1.voice:rewind()
+ else
+ v1.voice:play()
+ end
+ v1.prevChar = math.floor(v1.c.chat.char)
+ end
end
end
end