diff options
| author | 1029chris <1029chris@gmail.com> | 2016-08-08 00:05:07 -0700 |
|---|---|---|
| committer | 1029chris <1029chris@gmail.com> | 2016-08-08 00:05:07 -0700 |
| commit | 4515e6a967d283d3921a8695f9d093ef0688902e (patch) | |
| tree | 047d4f01dc5422ca35304af556028a9fd1d29dcd | |
| parent | f2c4f1b45619abfd6fdd079d00adfd25e4243ef3 (diff) | |
Starting Virus 2 fight
Added scene 3
Virus 2 appears after closing a popup
| -rw-r--r-- | desktop.lua | 2 | ||||
| -rw-r--r-- | main.lua | 2 | ||||
| -rw-r--r-- | panel.lua | 3 | ||||
| -rw-r--r-- | system.lua | 14 | ||||
| -rw-r--r-- | var.lua | 8 | ||||
| -rw-r--r-- | virus2.lua | 19 | ||||
| -rw-r--r-- | window.lua | 3 |
7 files changed, 43 insertions, 8 deletions
diff --git a/desktop.lua b/desktop.lua index b841974..e40fb2e 100644 --- a/desktop.lua +++ b/desktop.lua @@ -68,7 +68,7 @@ function drawIcon(id, x, y) end function checkIcon(id) if(sys.mouse.p.x >= icon[id].x+4 and sys.mouse.p.x <= icon[id].x+100 and sys.mouse.p.p == true - and sys.mouse.p.y >= icon[id].y and sys.mouse.p.y <= icon[id].y+75 and v1.yes == false) then + and sys.mouse.p.y >= icon[id].y and sys.mouse.p.y <= icon[id].y+75 and v1.yes == false and v2.start == false) then if icon[id].hl == false and icon[id].cl == false then icon[id].hl = true icon[id].cl = true @@ -112,6 +112,8 @@ function love.draw() drawLoading() elseif scene == 2 then drawVirusFight1() + elseif scene == 3 then + drawVirusFight2() elseif scene == 666 then drawBSOD() end @@ -69,7 +69,6 @@ function drawStart() start.o = false elseif start.o == false then start.o = true - --sendMessage(1, msgs[msg.c]) end end if v1.c.chat.msgs > 35 and v1.yes == true then @@ -139,7 +138,7 @@ function drawMenuItems(id) love.graphics.rectangle("fill", 35, 5+(id*55-55), 208, 50) love.graphics.setColor(colors.win.light) love.graphics.print(win[id].title, 85, 5+22+(id*55-55)) - if sys.mouse.p.p == true and v1.yes == false then + if sys.mouse.p.p == true and v1.yes == false and v2.start == false then if win[id].ex == true then win[id].ex = false win[id].s = 0.2 @@ -11,6 +11,17 @@ function updateSystem(dt) chat.status = 1 msgssent = msgssent + 1 end + if v1.complete == true and v2.start == false then + v2.startTime = v2.startTime + dt + if v2.startTime >= 20 then + v2.start = true + addPopup(false, sys.w/2-300, sys.h/2-200, 600, 400, 1, false, true) + end + if v2.startTime >= v2.startPopups and v2.start == false then + v2.startPopups = v2.startPopups + 5 + addPopup(true) + end + end end function drawSystem() love.graphics.setBackgroundColor(0, 128, 128) @@ -26,6 +37,9 @@ function drawSystem() for i=1,#layer do drawLayer((#layer+1)-i) end + if v1.complete == true and v2.complete == false then + drawPopups() + end drawStart() if start.o == true then drawMenu() @@ -193,10 +193,14 @@ function loadVar() v2.pop.add = false v2.pop.hov = 0 v2.msgs = {} - v2.c.x = 300 - v2.c.y = 300 + v2.c.x = sys.w/2 + v2.c.y = sys.h/2 v2.c.s = 1 v2.c.r = 0 + v2.startTime = 0 + v2.start = false + v2.startPopups = 10 + v2.complete = false expl.deb[1].x = 0 expl.deb[1].y = 0 expl.deb[1].ym = 5 @@ -1,4 +1,11 @@ function drawVirusFight2() + drawDesktop() + drawVirus2() + drawPopups() + if start.o == true then + drawMenu() + end + drawStart() end function drawPopup(id) love.graphics.setCanvas(v2.pop.p[id].cvs) @@ -35,7 +42,7 @@ function drawPopup(id) love.graphics.draw(v2.pop.a[v2.pop.p[id].ad], 8, 31, 0, (v2.pop.p[id].w-16)/640, (v2.pop.p[id].h-39)/400) love.graphics.setCanvas() end -function addPopup(rand, x, y, w, h, ad) +function addPopup(rand, x, y, w, h, ad, dup, m) if rand == true then table.insert(v2.pop.p, 1, { w = math.random(300,800), @@ -43,7 +50,8 @@ function addPopup(rand, x, y, w, h, ad) d = false, s = 0.2, exit = false, - add = false + add = false, + dup = true }) v2.pop.p[1].h = v2.pop.p[1].w/math.random(1.4,1.6,1.8,2) v2.pop.p[1].x = math.random(0,sys.w-v2.pop.p[1].w) @@ -54,7 +62,12 @@ function addPopup(rand, x, y, w, h, ad) v2.pop.p[1].d = true end elseif rand == false then - table.insert(v2.pop.p, 1, {x=x,y=y,w=w,h=h,ad=ad}) + table.insert(v2.pop.p, 1, {x=x,y=y,w=w,h=h,ad=ad,d=false,s=0.2,exit=false,add=false,dup=dup,m=m}) + v2.pop.p[1].cvs = love.graphics.newCanvas(v2.pop.p[1].w, v2.pop.p[1].h) + if v2.pop.p[1].d == false then + drawPopup(1) + v2.pop.p[1].d = true + end end end function drawPopups() @@ -115,6 +115,9 @@ function drawWindow(id) 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 v2.start == true then + win[id].ex = true + end if v1.yes == true and id == 2 and v1.timer >= 4 then layer.sendToFront = 2 end |
