From 38775e9090dacbd5a663b7eb900778d0e4852046 Mon Sep 17 00:00:00 2001 From: 1029chris <1029chris@gmail.com> Date: Sun, 16 Oct 2016 04:47:17 -0700 Subject: Added many attacks for Virus 2 started virus 2 fight its playable now its also 5 am --- virus1.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'virus1.lua') diff --git a/virus1.lua b/virus1.lua index b61db9e..11aa902 100644 --- a/virus1.lua +++ b/virus1.lua @@ -552,6 +552,9 @@ function addBullet(x,y,a,s,t,id) if t == "v1" then table.insert(v1.bullets, 1, {x=x,y=y,a=a,s=s*sys.s,spx=0,spy=0,rm=false,id=id}) end + if t == "v2" then + table.insert(v2.bullets, 1, {x=x,y=y,a=a,s=s*sys.s,spx=0,spy=0,rm=false,id=id}) + end end function drawBullets() for i=1,#v1.bullets do @@ -639,6 +642,19 @@ function drawBullets() end end end + if v2.start == true then + if av.bullets[i].x >= v2.c.x-110 and av.bullets[i].x <= v2.c.x+110 and av.bullets[i].y >= v2.c.y-110 and av.bullets[i].y <= v2.c.y+110 then + v2.c.health = v2.c.health - 5 + v2.spm = v2.spm + 0.20*(sys.h/1080) + v2.shake = 10 + av.bullets[i].rm = true + if antivirus.hit:isPlaying() == true then + antivirus.hit:rewind() + else + antivirus.hit:play() + end + end + end if av.bullets[i].x < 0 or av.bullets[i].x > sys.w or av.bullets[i].y < 0 or av.bullets[i].y > sys.h then av.bullets[i].rm = true if v1.c.chat.msgs >= 15 and v1.c.chat.msgs <= 22 and virus1Pissed == false then -- cgit