From 9766801068cbbf0910c427bfc258681b89615e14 Mon Sep 17 00:00:00 2001 From: 1029chris <1029chris@gmail.com> Date: Sat, 29 Oct 2016 23:23:11 -0700 Subject: Added speaking sounds to both viruses --- virus1.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'virus1.lua') 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 -- cgit