diff options
| -rw-r--r-- | assets.lua | 9 | ||||
| -rw-r--r-- | dialogue.lua | 13 | ||||
| -rw-r--r-- | main.lua | 5 | ||||
| -rw-r--r-- | virus1.lua | 66 | ||||
| -rw-r--r-- | window.lua | 33 |
5 files changed, 78 insertions, 48 deletions
@@ -120,13 +120,12 @@ function loadAssets() v1.c.chat.sp = 0.5 v1.c.chat.char = 0 v1.turret = {} - v1.turret[1] = {r=math.rad(30),x=0,y=0,rt=math.rad(30)} - v1.turret[2] = {r=math.rad(15),x=0,y=0,rt=math.rad(15)} - v1.turret[3] = {r=math.rad(-15),x=0,y=0,rt=math.rad(-15)} - v1.turret[4] = {r=math.rad(-30),x=0,y=0,rt=math.rad(-30)} + v1.turret[1] = {r=math.rad(30),x=0,y=0,rt=math.rad(30),t=0,tl=1} + v1.turret[2] = {r=math.rad(15),x=0,y=0,rt=math.rad(15),t=0,tl=2} + v1.turret[3] = {r=math.rad(-15),x=0,y=0,rt=math.rad(-15),t=0,tl=3} + v1.turret[4] = {r=math.rad(-30),x=0,y=0,rt=math.rad(-30),t=0,tl=4} v1.bullets = {} v1.bullet = love.graphics.newImage("assets/bullet_green.png") - v1.bulletTimer = 0 v1.c.idle = {} v1.c.idle.fs = {} v1.c.idle.pic = love.graphics.newImage("assets/virus1_idle_noeye.png") diff --git a/dialogue.lua b/dialogue.lua index ab63578..334eafe 100644 --- a/dialogue.lua +++ b/dialogue.lua @@ -42,9 +42,12 @@ function loadDia() v1.msgs[25] = "Ouch! It's stronger than I thought! No matter, because I have defenses of my own!" v1.msgs[26] = "Prepare youself for my UNIMAGINABLY DESTRUCTIVE POWER!" v1.msgs[27] = "Also, my giant battleship with multiple turrets." - v1.msgs[30] = "What do you think? I made it myself from the many computers I have conqured!" - v1.msgs[31] = "It doesn't really matter anyways, because your computer is about to become apart of it!" - v1.msgs[32] = "It's time to die! AHAHAHA!" - v1.msgs[34] = "Oh? A firewall? Well well well, this just got a bit more interesting." - v1.msgs[35] = "No matter, I WILL STILL DESTROY YOU! IT'S ABOUT TIME YOU SAW HOW POWERFUL A VIRUS CAN BE!" + v1.msgs[30] = "What do you think? I made it myself! It's made from the numerous computers I have DESTORYED!" + v1.msgs[31] = "These green lasers don't actually harm you, they take away your weapons charge!" + v1.msgs[32] = "The blue lasers hurt you, the red lasers cause you to stop dragging around the window!" + v1.msgs[33] = "Finally, the yellow lasers cause the window to spasm out of control until you catch it!" + v1.msgs[34] = "It'll only take me 5 minutes to take over this computer, and you won't have the chance to shoot me!" + v1.msgs[35] = "Now, it's time to get wriggity wriggity rekt son!" + v1.msgs[37] = "Oh? A firewall? Well well well, this just got a bit more interesting." + v1.msgs[38] = "No matter, I WILL STILL DESTROY YOU! IT'S ABOUT TIME YOU SAW HOW POWERFUL A VIRUS CAN BE!" end @@ -73,6 +73,11 @@ function love.mousepressed(x, y, button) sys.mouse.p.y = y sys.mouse.p.p = true end +function love.keyreleased(key) + if key == "f11" then + v1.c.chat.msgs = v1.c.chat.msgs + 1 + end +end function love.mousereleased(x, y, button) sys.mouse.p.p = false start.p = false @@ -28,7 +28,7 @@ function drawVirusFight1() 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 + win[4].y = sys.h/2+50 layer.sentToFront = 4 antivirus.scanning = true antivirus.prog = 0 @@ -90,7 +90,7 @@ function drawVirusFight1() v1.c.chat.char = 0 end end - if (v1.c.chat.msgs == 15 or v1.c.chat.msgs == 17 or v1.c.chat.msgs == 19 or v1.c.chat.msgs == 21) and av.charge == 40 then + if (v1.c.chat.msgs == 15 or v1.c.chat.msgs == 17 or v1.c.chat.msgs == 19 or v1.c.chat.msgs == 21 or v1.c.chat.msgs > 35) and av.charge == 40 then av.fireb = true end if av.charge < 40 then @@ -203,13 +203,13 @@ function drawVirusFight1() v1.c.yd = -500 v1.c.xd = sys.w/2 elseif v1.c.chat.msgs == 29 then - v1.c.yd = 180 + v1.c.yd = 140 v1.c.xd = sys.w/2 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) + drawBubble(v1.c.x+40, v1.c.y-135, 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 - and sys.mouse.p.y >= v1.c.y-165 and sys.mouse.p.y <= v1.c.y-165+110 and + and sys.mouse.p.y >= v1.c.y-135 and sys.mouse.p.y <= v1.c.y-135+110 and v1.c.chat.next == false and sys.mouse.drag == false and v1.c.chat.msgs ~= 15 and v1.c.chat.msgs ~= 17 and v1.c.chat.msgs ~= 19 and v1.c.chat.msgs ~= 21) then v1.c.chat.next = true @@ -245,20 +245,25 @@ function drawVirusFight1() v1.c.chat.msgs = 29 v1.c.chat.char = 0 v1.c.chat.msg = "" - elseif v1.c.chat.msgs == 29 and v1.c.y == 180 then + elseif v1.c.chat.msgs == 29 and v1.c.y == 140 then v1.c.chat.msgs = 30 v1.c.chat.char = 0 v1.c.chat.msg = "" end - if v1.c.chat.msgs > 32 and v1.bulletTimer > 1 then - local x = math.cos(v1.turret[1].r+math.rad(90))*(v1.turret[1].x+148-v1.turret[1].x) - -math.sin(v1.turret[1].r+math.rad(90))*(v1.turret[1].y-v1.turret[1].y)+v1.turret[1].x - local y = math.sin(v1.turret[1].r+math.rad(90))*(v1.turret[1].x+148-v1.turret[1].x) - +math.cos(v1.turret[1].r+math.rad(90))*(v1.turret[1].y-v1.turret[1].y)+v1.turret[1].y - addBullet(x,y,v1.turret[1].r+math.rad(90),25,"v1") - v1.bulletTimer = 0 - elseif v1.c.chat.msgs > 32 and v1.bulletTimer < 2 then - v1.bulletTimer = v1.bulletTimer + delta + if v1.c.chat.msgs > 35 then + for i=1,4 do + if v1.turret[i].t > v1.turret[i].tl then + local x = math.cos(v1.turret[i].r+math.rad(90))*(v1.turret[i].x+148-v1.turret[i].x) + -math.sin(v1.turret[i].r+math.rad(90))*(v1.turret[i].y-v1.turret[i].y)+v1.turret[i].x + local y = math.sin(v1.turret[i].r+math.rad(90))*(v1.turret[i].x+148-v1.turret[i].x) + +math.cos(v1.turret[i].r+math.rad(90))*(v1.turret[i].y-v1.turret[i].y)+v1.turret[i].y + addBullet(x,y,v1.turret[i].r+math.rad(90),10,"v1") + v1.turret[i].t = 0 + v1.turret[i].tl = math.random(2,3,4,5) + elseif v1.turret[i].t < v1.turret[i].tl then + v1.turret[i].t = v1.turret[i].t+delta + 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 @@ -371,16 +376,27 @@ function addBullet(x,y,a,s,t) end function drawBullets() for i=1,#v1.bullets do - v1.bullets[i].spx = v1.bullets[i].s * math.cos(v1.bullets[i].a) - v1.bullets[i].spy = v1.bullets[i].s * math.sin(v1.bullets[i].a) - v1.bullets[i].x = v1.bullets[i].x + v1.bullets[i].spx - v1.bullets[i].y = v1.bullets[i].y + v1.bullets[i].spy - love.graphics.draw(v1.bullet, v1.bullets[i].x, v1.bullets[i].y, v1.bullets[i].a, 1.5, 1.5, 23/2, 7) - if v1.bullets[i].x < 0 or v1.bullets[i].x > sys.w or v1.bullets[i].y < 0 or v1.bullets[i].y > sys.h then - v1.bullets[i].rm = true - end - if v1.bullets[i].rm == true then - table.remove(v1.bullets, i) + if v1.bullets[i] ~= nil then + v1.bullets[i].spx = v1.bullets[i].s * math.cos(v1.bullets[i].a) + v1.bullets[i].spy = v1.bullets[i].s * math.sin(v1.bullets[i].a) + v1.bullets[i].x = v1.bullets[i].x + v1.bullets[i].spx + v1.bullets[i].y = v1.bullets[i].y + v1.bullets[i].spy + love.graphics.draw(v1.bullet, v1.bullets[i].x, v1.bullets[i].y, v1.bullets[i].a, 1.5, 1.5, 23/2, 7) + if v1.bullets[i].x < 0 or v1.bullets[i].x > sys.w or v1.bullets[i].y < 0 or v1.bullets[i].y > sys.h then + v1.bullets[i].rm = true + end + if (v1.bullets[i].x >= win[4].x and v1.bullets[i].x <= win[4].x+win[4].w + and v1.bullets[i].y >= win[4].y and v1.bullets[i].y <= win[4].y+win[4].h) then + v1.bullets[i].rm = true + if av.charge - 10 < 0 then + av.charge = 0 + else + av.charge = av.charge - 10 + end + end + if v1.bullets[i].rm == true then + table.remove(v1.bullets, i) + end end end for i=1,#av.bullets do @@ -82,19 +82,10 @@ function drawWindow(id) win[id].py = win[id].y end if sys.mouse.drag == true and win[id].min == false and win[id].ex == false and layer[1] == id then - if win[id].px+(sys.mouse.x - sys.mouse.p.x) >= 0 and win[id].px+(sys.mouse.x - sys.mouse.p.x) <= sys.w-win[id].w then - win[id].x = win[id].px + (sys.mouse.x - sys.mouse.p.x) - elseif win[id].px+(sys.mouse.x - sys.mouse.p.x) < 0 then - win[id].x = 0 - elseif win[id].px+(sys.mouse.x - sys.mouse.p.x) > sys.w-win[id].w then - win[id].x = sys.w-win[id].w - end - if win[id].py+(sys.mouse.y - sys.mouse.p.y) >= 0 and win[id].py+(sys.mouse.y - sys.mouse.p.y) <= sys.h-win[id].h-panel.thick-1 then - win[id].y = win[id].py + (sys.mouse.y - sys.mouse.p.y) - elseif win[id].py+(sys.mouse.y - sys.mouse.p.y) < 0 then - win[id].y = 0 - elseif win[id].py+(sys.mouse.y - sys.mouse.p.y) > sys.h-win[id].h-panel.thick-1 then - win[id].y = sys.h-win[id].h-panel.thick-1 + if id == 4 and v1.yes == true then + windowMouseMove(id,0,sys.w-win[id].w,sys.h/2,sys.h-win[id].h-panel.thick-1) + else + windowMouseMove(id,0,sys.w-win[id].w,0,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 and v1.c.chat.msgs < 7 then @@ -207,3 +198,19 @@ function closeWindow(id) win[id].layer = 0 end end +function windowMouseMove(id,limitx,limitw,limity,limith) + if win[id].px+(sys.mouse.x - sys.mouse.p.x) >= limitx and win[id].px+(sys.mouse.x - sys.mouse.p.x) <= limitw then + win[id].x = win[id].px + (sys.mouse.x - sys.mouse.p.x) + elseif win[id].px+(sys.mouse.x - sys.mouse.p.x) < limitx then + win[id].x = limitx + elseif win[id].px+(sys.mouse.x - sys.mouse.p.x) > limitw then + win[id].x = limitw + end + if win[id].py+(sys.mouse.y - sys.mouse.p.y) >= limity and win[id].py+(sys.mouse.y - sys.mouse.p.y) <= limith then + win[id].y = win[id].py + (sys.mouse.y - sys.mouse.p.y) + elseif win[id].py+(sys.mouse.y - sys.mouse.p.y) < limity then + win[id].y = limity + elseif win[id].py+(sys.mouse.y - sys.mouse.p.y) > limith then + win[id].y = limith + end +end |
