aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assets.lua4
-rw-r--r--assets/virus2_hands_fist.pngbin0 -> 22658 bytes
-rw-r--r--assets/virus2_hands_gunidle.pngbin0 -> 24853 bytes
-rw-r--r--assets/virus2_shotgun_cock.oggbin0 -> 9560 bytes
-rw-r--r--assets/virus2_shotgun_fire.oggbin0 -> 14175 bytes
-rw-r--r--var.lua7
-rw-r--r--virus2.lua65
7 files changed, 75 insertions, 1 deletions
diff --git a/assets.lua b/assets.lua
index d105904..b8a1da6 100644
--- a/assets.lua
+++ b/assets.lua
@@ -237,7 +237,11 @@ function loadAssets(id)
v2.c.idle.pic = love.graphics.newImage("assets/virus2_idle.png")
v2.c.pupil = love.graphics.newImage("assets/virus2_pupil.png")
v2.c.idle.hands = love.graphics.newImage("assets/virus2_hands_idle.png")
+ v2.c.idle.gunidle = love.graphics.newImage("assets/virus2_hands_gunidle.png")
+ v2.c.idle.fist = love.graphics.newImage("assets/virus2_hands_fist.png")
v2.c.idle.f = 1
+ v2.c.cockgun = love.audio.newSource("assets/virus2_shotgun_cock.ogg")
+ v2.c.cockgunplay = false
loadAnimation(v2.c.idle.pic, v2.c.idle.fs, 37, 10, 250, 250)
v2.c.idle.mask = {}
v2.c.idle.mask.fs = {}
diff --git a/assets/virus2_hands_fist.png b/assets/virus2_hands_fist.png
new file mode 100644
index 0000000..09fc6ad
--- /dev/null
+++ b/assets/virus2_hands_fist.png
Binary files differ
diff --git a/assets/virus2_hands_gunidle.png b/assets/virus2_hands_gunidle.png
new file mode 100644
index 0000000..b492ee8
--- /dev/null
+++ b/assets/virus2_hands_gunidle.png
Binary files differ
diff --git a/assets/virus2_shotgun_cock.ogg b/assets/virus2_shotgun_cock.ogg
new file mode 100644
index 0000000..76a095c
--- /dev/null
+++ b/assets/virus2_shotgun_cock.ogg
Binary files differ
diff --git a/assets/virus2_shotgun_fire.ogg b/assets/virus2_shotgun_fire.ogg
new file mode 100644
index 0000000..9874782
--- /dev/null
+++ b/assets/virus2_shotgun_fire.ogg
Binary files differ
diff --git a/var.lua b/var.lua
index 91a8c1b..fea9bc3 100644
--- a/var.lua
+++ b/var.lua
@@ -197,6 +197,12 @@ function loadVar()
v2.c.y = sys.h/2
v2.c.s = 1
v2.c.r = 0
+ v2.c.xd = 0
+ v2.c.yd = 0
+ v2.c.spx = 0
+ v2.c.spy = 0
+ v2.c.sp = 1
+ v2.c.angle = 0
v2.startTime = 0
v2.start = false
v2.startPopups = 10
@@ -208,6 +214,7 @@ function loadVar()
v2.c.chat.sp = 0.5
v2.c.chat.char = 0
v2.c.chat.time = 0
+ v2.c.handp = "idle"
expl.deb[1].x = 0
expl.deb[1].y = 0
expl.deb[1].ym = 5
diff --git a/virus2.lua b/virus2.lua
index 19ef279..76af7ce 100644
--- a/virus2.lua
+++ b/virus2.lua
@@ -6,6 +6,33 @@ function drawVirusFight2()
drawMenu()
end
drawStart()
+ if v2.c.chat.msgs == 1 or v2.c.chat.msgs == 6 then
+ v2.c.xd = sys.w/2
+ v2.c.yd = sys.h/3
+ if v2.c.chat.msgs == 6 then
+ v2.c.handp = "fist"
+ end
+ elseif v2.c.chat.msgs == 2 then
+ v2.c.xd = sys.w/3
+ v2.c.yd = sys.h/1.7
+ elseif v2.c.chat.msgs == 3 then
+ v2.c.xd = sys.w/3
+ v2.c.yd = sys.h/3
+ elseif v2.c.chat.msgs == 4 then
+ v2.c.xd = sys.w/1.7
+ v2.c.yd = sys.h/1.7
+ elseif v2.c.chat.msgs == 5 then
+ v2.c.xd = sys.w/2
+ v2.c.yd = sys.h/2
+ elseif v2.c.chat.msgs == 8 then
+ v2.c.xd = sys.w/2
+ v2.c.yd = sys.h/2
+ v2.c.handp = "gunidle"
+ if v2.c.cockgunplay == false then
+ v2.c.cockgun:play()
+ v2.c.cockgunplay = true
+ end
+ end
end
function drawPopup(id)
love.graphics.setCanvas(v2.pop.p[id].cvs)
@@ -132,7 +159,43 @@ function drawVirus2()
love.graphics.draw(v2.c.pupil, v2.c.x-26+math.random(-0.7,0.7),v2.c.y-57+math.random(-0.7,0.7),v2.c.r,v2.c.s)
love.graphics.draw(v2.c.pupil, v2.c.x+21+math.random(-0.7,0.7),v2.c.y-57+math.random(-0.7,0.7),v2.c.r,v2.c.s)
love.graphics.setStencilTest()
- love.graphics.draw(v2.c.idle.hands, v2.c.x, v2.c.y, v2.c.r, v2.c.s, v2.c.s, 125, 125)
+ v2.c.sp = math.sqrt(math.abs(v2.c.xd - v2.c.x)*2 + math.abs(v2.c.yd - v2.c.y)*2)/5
+ v2.c.angle = math.atan2((v2.c.yd - v2.c.y), (v2.c.xd - v2.c.x))
+ v2.c.spx = v2.c.sp * math.cos(v2.c.angle)
+ v2.c.spy = v2.c.sp * math.sin(v2.c.angle)
+ if v2.c.x > v2.c.xd then
+ if v2.c.x + v2.c.spx <= v2.c.xd then
+ v2.c.x = v2.c.xd
+ else
+ v2.c.x = v2.c.x + v2.c.spx
+ end
+ elseif v2.c.x < v2.c.xd then
+ if v2.c.x + v2.c.spx >= v2.c.xd then
+ v2.c.x = v2.c.xd
+ else
+ v2.c.x = v2.c.x + v2.c.spx
+ end
+ end
+ if v2.c.y > v2.c.yd then
+ if v2.c.y + v2.c.spy <= v2.c.yd then
+ v2.c.y = v2.c.yd
+ else
+ v2.c.y = v2.c.y + v2.c.spy
+ end
+ elseif v2.c.y < v2.c.yd then
+ if v2.c.y + v2.c.spy >= v2.c.yd then
+ v2.c.y = v2.c.yd
+ else
+ v2.c.y = v2.c.y + v2.c.spy
+ end
+ end
+ if v2.c.handp == "idle" then
+ love.graphics.draw(v2.c.idle.hands, v2.c.x, v2.c.y, v2.c.r, v2.c.s, v2.c.s, 125, 125)
+ elseif v2.c.handp == "fist" then
+ love.graphics.draw(v2.c.idle.fist, v2.c.x, v2.c.y, v2.c.r, v2.c.s, v2.c.s, 125, 125)
+ elseif v2.c.handp == "gunidle" then
+ love.graphics.draw(v2.c.idle.gunidle, v2.c.x, v2.c.y, v2.c.r, v2.c.s, v2.c.s, 125, 125)
+ end
if v2.c.chat.time >= 2 then
drawBubble(v2.c.x+50, v2.c.y-160, 300, 115, v2.c.chat.msg)
if mouseClick(v2.c.x+50,v2.c.y-160,300,110) == true and v2.c.chat.next == false then