aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assets.lua2
-rw-r--r--virus1.lua109
-rw-r--r--window.lua2
3 files changed, 73 insertions, 40 deletions
diff --git a/assets.lua b/assets.lua
index 21f46c2..711c0d1 100644
--- a/assets.lua
+++ b/assets.lua
@@ -150,6 +150,8 @@ function loadAssets()
v1.c.load = false
v1.c.eyex = 0
v1.c.eyey = 0
+ v1.c.eyetx = 0
+ v1.c.eyety = 0
expl = {}
expl.frames = {}
expl.pic = love.graphics.newImage("assets/explosion.png")
diff --git a/virus1.lua b/virus1.lua
index 9eb0a85..947328f 100644
--- a/virus1.lua
+++ b/virus1.lua
@@ -6,6 +6,7 @@ function drawVirusFight1()
v1.introplay = true
end
if v1.explodeintro == false then
+ sys.mouse.drag = false
love.graphics.setColor(255,255,255)
love.graphics.draw(win[2].cvs, win[2].x+math.random(v1.shakemin,v1.shakemax),
win[2].y+math.random(v1.shakemin,v1.shakemax), 0, 1, 1, 0, 0,
@@ -22,6 +23,18 @@ function drawVirusFight1()
setWindow(2)
setPanel(2)
end
+ if v1.c.chat.msgs == 6 then
+ win[4].ex = false
+ win[4].s = 0.2
+ win[4].oldlayer = win[4].layer
+ win[4].x = sys.w/2-100+7
+ win[4].y = sys.h/2-75
+ layer.sentToFront = 4
+ end
+ if v1.c.chat.msgs > 7 then
+ orderWindows()
+ love.graphics.draw(win[4].cvs, win[4].x, win[4].y, 0, win[4].s)
+ end
if v1.timer >= 16 then
music.tension1:play()
end
@@ -34,21 +47,40 @@ function drawVirusFight1()
v1.c.load = true
end
love.graphics.setColor(0,0,0,100)
- playAnimation(v1.c.idle, true, v1.c.x-40, v1.c.y+40, v1.c.r, v1.c.s, 100, 100, 0.5)
+ playAnimation(v1.c.idle, true, v1.c.x+40, v1.c.y+40, v1.c.r, v1.c.s, 100, 100, 0.5)
love.graphics.setColor(255,255,255)
love.graphics.draw(v1.c.eye, v1.c.x-32, v1.c.y-50, v1.c.r, v1.c.s*0.9, v1.c.s*1.1)
- if sys.mouse.x > v1.c.x+7+v1.c.eyex and v1.c.eyex < 15 then
+ if v1.c.chat.msgs < 3 or v1.c.chat.msgs >= 11 then
+ v1.c.eyex = 0
+ v1.c.eyey = 0
+ v1.c.eyetx = v1.c.x+7
+ v1.c.eyety = v1.c.y-28
+ elseif v1.c.chat.msgs >= 3 and v1.c.chat.msgs <= 7 then
+ v1.c.eyetx = sys.mouse.x
+ v1.c.eyety = sys.mouse.y
+ elseif v1.c.chat.msgs > 7 and v1.c.chat.msgs <= 10 then
+ v1.c.eyetx = win[4].x+100
+ v1.c.eyety = win[4].y+75
+ end
+ if v1.c.eyetx > v1.c.x+7+v1.c.eyex and v1.c.eyex < 15 then
v1.c.eyex = v1.c.eyex + 3
- elseif sys.mouse.x < v1.c.x+7+v1.c.eyex and v1.c.eyex > -15 then
+ elseif v1.c.eyetx < v1.c.x+7+v1.c.eyex and v1.c.eyex > -15 then
v1.c.eyex = v1.c.eyex - 3
end
- if sys.mouse.y > v1.c.y-28+v1.c.eyey and v1.c.eyey < 5 then
+ if v1.c.eyety > v1.c.y-28+v1.c.eyey and v1.c.eyey < 5 then
v1.c.eyey = v1.c.eyey + 3
- elseif sys.mouse.y < v1.c.y-28+v1.c.eyey and v1.c.eyey > -10 then
+ elseif v1.c.eyety < v1.c.y-28+v1.c.eyey and v1.c.eyey > -10 then
v1.c.eyey = v1.c.eyey - 3
end
love.graphics.draw(v1.c.pupil, v1.c.x+7+v1.c.eyex+math.random(0,0.5), v1.c.y-28+v1.c.eyey+math.random(0,0.5), v1.c.r, v1.c.s*1.2, v1.c.s*1.2, 3, 11)
playAnimation(v1.c.idle, true, v1.c.x, v1.c.y, v1.c.r, v1.c.s, 100, 100, 0.5)
+ if v1.c.chat.msgs == 2 then
+ v1.c.xd = sys.w/2
+ v1.c.yd = sys.h/2
+ elseif v1.c.chat.msgs == 8 then
+ v1.c.xd = sys.w/2
+ v1.c.yd = 200
+ end
if v1.c.shine.s < -50 and v1.msgs[v1.c.chat.msgs] ~= nil then
drawBubble(v1.c.x+40, v1.c.y-165, 300, 115, v1.c.chat.msg)
if (sys.mouse.p.x >= v1.c.x+40 and sys.mouse.p.x <= v1.c.x+40+300
@@ -58,40 +90,6 @@ function drawVirusFight1()
v1.c.chat.msgs = v1.c.chat.msgs + 1
v1.c.chat.char = 0
end
- if v1.c.chat.msgs == 2 then
- v1.c.xd = sys.w/2
- v1.c.yd = sys.h/2
- end
- v1.c.sp = math.sqrt(math.abs(v1.c.xd - v1.c.x)*2 + math.abs(v1.c.yd - v1.c.y)*2)/5
- v1.c.angle = math.atan2((v1.c.yd - v1.c.y), (v1.c.xd - v1.c.x))
- v1.c.spx = v1.c.sp * math.cos(v1.c.angle)
- v1.c.spy = v1.c.sp * math.sin(v1.c.angle)
- if v1.c.x > v1.c.xd then
- if v1.c.x + v1.c.spx <= v1.c.xd then
- v1.c.x = v1.c.xd
- else
- v1.c.x = v1.c.x + v1.c.spx
- end
- elseif v1.c.x < v1.c.xd then
- if v1.c.x + v1.c.spx >= v1.c.xd then
- v1.c.x = v1.c.xd
- else
- v1.c.x = v1.c.x + v1.c.spx
- end
- end
- if v1.c.y > v1.c.yd then
- if v1.c.y + v1.c.spy <= v1.c.yd then
- v1.c.y = v1.c.yd
- else
- v1.c.y = v1.c.y + v1.c.spy
- end
- elseif v1.c.y < v1.c.yd then
- if v1.c.y + v1.c.spy >= v1.c.yd then
- v1.c.y = v1.c.yd
- else
- v1.c.y = v1.c.y + v1.c.spy
- end
- end
if v1.msgs[v1.c.chat.msgs] ~= nil then
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())
@@ -99,6 +97,39 @@ function drawVirusFight1()
end
end
end
+ v1.c.sp = math.sqrt(math.abs(v1.c.xd - v1.c.x)*2 + math.abs(v1.c.yd - v1.c.y)*2)/5
+ if v1.c.chat.msgs == 8 then
+ v1.c.sp = v1.c.sp*2
+ end
+ v1.c.angle = math.atan2((v1.c.yd - v1.c.y), (v1.c.xd - v1.c.x))
+ v1.c.spx = v1.c.sp * math.cos(v1.c.angle)
+ v1.c.spy = v1.c.sp * math.sin(v1.c.angle)
+ if v1.c.x > v1.c.xd then
+ if v1.c.x + v1.c.spx <= v1.c.xd then
+ v1.c.x = v1.c.xd
+ else
+ v1.c.x = v1.c.x + v1.c.spx
+ end
+ elseif v1.c.x < v1.c.xd then
+ if v1.c.x + v1.c.spx >= v1.c.xd then
+ v1.c.x = v1.c.xd
+ else
+ v1.c.x = v1.c.x + v1.c.spx
+ end
+ end
+ if v1.c.y > v1.c.yd then
+ if v1.c.y + v1.c.spy <= v1.c.yd then
+ v1.c.y = v1.c.yd
+ else
+ v1.c.y = v1.c.y + v1.c.spy
+ end
+ elseif v1.c.y < v1.c.yd then
+ if v1.c.y + v1.c.spy >= v1.c.yd then
+ v1.c.y = v1.c.yd
+ else
+ v1.c.y = v1.c.y + v1.c.spy
+ end
+ end
end
if v1.timer >= 16 then
love.graphics.setColor(255,255,255)
diff --git a/window.lua b/window.lua
index 32ebab8..a500ea6 100644
--- a/window.lua
+++ b/window.lua
@@ -97,7 +97,7 @@ function drawWindow(id)
win[id].y = sys.h-win[id].h-panel.thick-1
end
end
- if v1.yes == true and id ~= 2 and win[id].ex == false and v1.timer >= 4 then
+ if v1.yes == true and id ~= 2 and win[id].ex == false and v1.timer >= 4 and v1.c.chat.msgs < 7 then
win[id].ex = true
end
if v1.yes == true and id == 2 and v1.timer >= 4 then