diff options
| author | 1029chris <1029chris@gmail.com> | 2016-04-23 22:21:44 -0700 |
|---|---|---|
| committer | 1029chris <1029chris@gmail.com> | 2016-04-23 22:21:44 -0700 |
| commit | 71f5a8ab5a6c7e0be59bd6ae5ba8a054fb5fca29 (patch) | |
| tree | 33d65eec535adc1748543f65246ed2a236919fb6 | |
| parent | 829a6ac12c00d12261c15640de391aee1076d8c7 (diff) | |
Added fire button
| -rw-r--r-- | var.lua | 3 | ||||
| -rw-r--r-- | virus1.lua | 22 |
2 files changed, 24 insertions, 1 deletions
@@ -97,6 +97,9 @@ function loadVar() av.wings = 0 av.gun = 0 av.transform = false + av.charge = 0 + av.fireb = false + av.fire = false chat.status = 0 chat.profilename = "Best Friend" colors = {} @@ -49,6 +49,14 @@ function drawVirusFight1() love.graphics.draw(antivirus.gun, win[4].x+138/2+99+math.random(-1,1), win[4].y+5-av.gun+math.random(-1,1), 0, win[4].s, win[4].s, 12) end love.graphics.draw(antivirus.body, win[4].x+138/2+99, win[4].y+5, 0, win[4].s, win[4].s, 80) + if av.fireb == true then + drawUpBox(win[4].x+138/2+71, win[4].y+93, 56, 19, 2) + else + drawDownBox(win[4].x+138/2+71, win[4].y+93, 56, 19, 2) + end + love.graphics.setColor(colors.font.dark) + love.graphics.print("FIRE", win[4].x+138/2+76, win[4].y+99) + love.graphics.setColor(256,256,256) if av.wings == 138/2 then love.graphics.draw(antivirus.left, win[4].x+138/2-av.wings, win[4].y, 0, win[4].s) love.graphics.draw(antivirus.right, win[4].x+138/2+97+av.wings, win[4].y, 0, win[4].s) @@ -64,6 +72,18 @@ function drawVirusFight1() if av.wings == 138/2 and av.gun ~= 98 then av.gun = av.gun + 1 end + if (sys.mouse.p.x >= win[4].x+138/2+71 and sys.mouse.p.x <= (win[4].x+138/2+71)+56 and av.fireb == true + and sys.mouse.p.y >= win[4].y+93 and sys.mouse.p.y <= (win[4].y+93)+19 and sys.mouse.drag == false and sys.mouse.p.p == true) then + av.fire = true + av.fireb = false + av.charge = 0 + if v1.c.chat.msgs == 15 then + v1.c.chat.msgs = 16 + end + end + if v1.c.chat.msgs == 15 then + av.fireb = true + end end end if v1.timer >= 16 then @@ -114,7 +134,7 @@ function drawVirusFight1() 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 and sys.mouse.p.y >= v1.c.y-165 and sys.mouse.p.y <= v1.c.y-165+110 and - v1.c.chat.next == false and sys.mouse.drag == false) then + v1.c.chat.next == false and sys.mouse.drag == false and v1.c.chat.msgs ~= 15) then v1.c.chat.next = true v1.c.chat.msgs = v1.c.chat.msgs + 1 v1.c.chat.char = 0 |
