aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author1029chris <1029chris@gmail.com>2016-08-21 18:08:29 -0700
committer1029chris <1029chris@gmail.com>2016-08-21 18:08:29 -0700
commit4f6e2d326e04a18e867f3129ac846502651bd5aa (patch)
tree2ac899d60e8d17fb07fc93b062965a4c257d1631
parent11ef7059e98555914a1bdebaae37433d64942c4e (diff)
Virus 2 blows a hole in the popup, it falls down.
-rw-r--r--assets.lua2
-rw-r--r--assets/popup_shot.pngbin0 -> 230397 bytes
-rw-r--r--var.lua9
-rw-r--r--virus2.lua23
4 files changed, 33 insertions, 1 deletions
diff --git a/assets.lua b/assets.lua
index b8a1da6..c8256b6 100644
--- a/assets.lua
+++ b/assets.lua
@@ -124,6 +124,7 @@ function loadAssets(id)
for i=1,10 do
v2.pop.a[i] = love.graphics.newImage("assets/popup" .. i .. ".png")
end
+ v2.popshot = love.graphics.newImage("assets/popup_shot.png")
end
if id == 10 then
internet = {
@@ -241,6 +242,7 @@ function loadAssets(id)
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.fire = love.audio.newSource("assets/virus2_shotgun_fire.ogg")
v2.c.cockgunplay = false
loadAnimation(v2.c.idle.pic, v2.c.idle.fs, 37, 10, 250, 250)
v2.c.idle.mask = {}
diff --git a/assets/popup_shot.png b/assets/popup_shot.png
new file mode 100644
index 0000000..3494205
--- /dev/null
+++ b/assets/popup_shot.png
Binary files differ
diff --git a/var.lua b/var.lua
index fea9bc3..7dfc374 100644
--- a/var.lua
+++ b/var.lua
@@ -207,6 +207,12 @@ function loadVar()
v2.start = false
v2.startPopups = 10
v2.complete = false
+ v2.popshotx = sys.w/2
+ v2.popshoty = sys.h/2
+ v2.popshotsh = 10
+ v2.popshotm = -15
+ v2.popshotr = 0
+ v2.popshots = false
v2.c.chat = {}
v2.c.chat.next = false
v2.c.chat.msgs = 1
@@ -214,7 +220,8 @@ function loadVar()
v2.c.chat.sp = 0.5
v2.c.chat.char = 0
v2.c.chat.time = 0
- v2.c.handp = "idle"
+ v2.c.handp = "gunfront"
+ v2.explodeFrame = 1
expl.deb[1].x = 0
expl.deb[1].y = 0
expl.deb[1].ym = 5
diff --git a/virus2.lua b/virus2.lua
index 76af7ce..3e4295d 100644
--- a/virus2.lua
+++ b/virus2.lua
@@ -2,6 +2,27 @@ function drawVirusFight2()
drawDesktop()
drawVirus2()
drawPopups()
+ if v2.popshoty < sys.h+1000 then
+ if v2.popshots == false then
+ v2.c.fire:play()
+ v2.popshots = true
+ end
+ love.graphics.setColor(256,256,256)
+ love.graphics.draw(v2.popshot, v2.popshotx+math.random(-v2.popshotsh,v2.popshotsh),
+ v2.popshoty+math.random(-v2.popshotsh,v2.popshotsh), v2.popshotr+math.rad(math.random(-v2.popshotsh,v2.popshotsh)), 1, 1, 300, 200)
+ if v2.popshotsh > 0 then
+ v2.popshotsh = v2.popshotsh - 0.5*sys.s
+ end
+ v2.popshoty = v2.popshoty + v2.popshotm*sys.s
+ v2.popshotm = v2.popshotm + 0.75*sys.s
+ v2.popshotr = v2.popshotr + math.rad(1*sys.s)
+ if v2.explodeFrame <= 89 then
+ love.graphics.setColor(255,255,255)
+ love.graphics.draw(expl.pic, expl.frames[math.floor(v2.explodeFrame)], sys.w/2, sys.h/2, 0, 2.5, 2.5, 320/2,240/2)
+ v2.explodeFrame = v2.explodeFrame + 1*sys.s
+ v1.explosionSound:play()
+ end
+ end
if start.o == true then
drawMenu()
end
@@ -11,6 +32,8 @@ function drawVirusFight2()
v2.c.yd = sys.h/3
if v2.c.chat.msgs == 6 then
v2.c.handp = "fist"
+ elseif v2.c.chat.msgs == 1 then
+ v2.c.handp = "gunfront"
end
elseif v2.c.chat.msgs == 2 then
v2.c.xd = sys.w/3