diff options
| -rw-r--r-- | assets.lua | 2 | ||||
| -rw-r--r-- | assets/virus1_voice.ogg | bin | 0 -> 5491 bytes | |||
| -rw-r--r-- | assets/virus2_voice.ogg | bin | 0 -> 5717 bytes | |||
| -rw-r--r-- | var.lua | 2 | ||||
| -rw-r--r-- | virus1.lua | 10 | ||||
| -rw-r--r-- | virus2.lua | 10 |
6 files changed, 24 insertions, 0 deletions
@@ -182,6 +182,7 @@ function loadAssets(id) tent2 = love.graphics.newImage("assets/tentacle2.png"), lidup = love.graphics.newImage("assets/v1_upper_eyelid.png"), lidlow = love.graphics.newImage("assets/v1_lower_eyelid.png") + voice = love.audio.newSource("assets/virus1_voice.ogg") } end if id == 14 then @@ -266,6 +267,7 @@ function loadAssets(id) v2.c.idle.mask.fs = {} v2.c.idle.mask.pic = love.graphics.newImage("assets/virus2_idle_mask.png") v2.c.idle.mask.f = 1 + v2.voice = love.audio.newSource("assets/virus2_voice.ogg") loadAnimation(v2.c.idle.mask.pic, v2.c.idle.mask.fs, 37, 10, 250, 250) end if id == 15 then diff --git a/assets/virus1_voice.ogg b/assets/virus1_voice.ogg Binary files differnew file mode 100644 index 0000000..20ce66e --- /dev/null +++ b/assets/virus1_voice.ogg diff --git a/assets/virus2_voice.ogg b/assets/virus2_voice.ogg Binary files differnew file mode 100644 index 0000000..120a6f4 --- /dev/null +++ b/assets/virus2_voice.ogg @@ -189,6 +189,7 @@ function loadVar() v1.lid.upyd = -25 v1.lid.bTimer = math.random(4,8) v1.lid.b = false + v1.prevChar = 0 v2.pop.p = {} v2.pop.add = false v2.pop.hov = 0 @@ -243,6 +244,7 @@ function loadVar() v2.nextAttack = 20 v2.popupTimer = 60 v2.shotgunTimer = 10 + v2.prevChar = 0 expl.deb[1].x = 0 expl.deb[1].y = 0 expl.deb[1].ym = 5 @@ -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 @@ -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 |
