diff options
| author | 1029chris <1029chris@gmail.com> | 2016-10-29 23:23:11 -0700 |
|---|---|---|
| committer | 1029chris <1029chris@gmail.com> | 2016-10-29 23:23:11 -0700 |
| commit | 9766801068cbbf0910c427bfc258681b89615e14 (patch) | |
| tree | fdeadf4ff6615d5d41736e6edaf5fe49b808b09a /virus2.lua | |
| parent | c1c74810562915bf45e74cbef174d6caf13b0db2 (diff) | |
Added speaking sounds to both viruses
Diffstat (limited to 'virus2.lua')
| -rw-r--r-- | virus2.lua | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -415,6 +415,16 @@ function drawVirus2() if string.len(v2.msgs[v2.c.chat.msgs]) ~= string.len(v2.c.chat.msg) then v2.c.chat.char = v2.c.chat.char + v2.c.chat.sp*(60/love.timer.getFPS()) v2.c.chat.msg = string.sub(v2.msgs[v2.c.chat.msgs], 1, math.floor(v2.c.chat.char)) + if math.floor(v2.c.chat.char) ~= math.floor(v2.prevChar) then + v2.voice:setPitch(math.random(10,14)/10) + v2.voice:setVolume(0.4) + if v2.voice:isPlaying() == true then + v2.voice:rewind() + else + v2.voice:play() + end + v2.prevChar = math.floor(v2.c.chat.char) + end end end else |
