aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author1029chris <1029chris@gmail.com>2016-06-17 19:35:08 -0700
committer1029chris <1029chris@gmail.com>2016-06-17 19:35:08 -0700
commit2d1a3d66b8e0b01d5c9b560898a7bf7f218109e2 (patch)
treedba2d0d5ef18c8910435da82af7a12cbbe3540bf
parentd1341f6052ef11d24ccda0b87423a4eac66385bb (diff)
Finished tentacle effect
-rw-r--r--assets.lua1
-rw-r--r--assets/fade.pngbin0 -> 310 bytes
-rw-r--r--desktop.lua94
-rw-r--r--var.lua2
4 files changed, 75 insertions, 22 deletions
diff --git a/assets.lua b/assets.lua
index 5506d23..f489eae 100644
--- a/assets.lua
+++ b/assets.lua
@@ -172,6 +172,7 @@ function loadAssets(id)
if id == 14 then
v1.c = {}
v1.c.chat = {}
+ v1.fadeImg = love.graphics.newImage("assets/fade.png")
v1.rumbleLoop:setLooping(true)
v1.turret = {}
v1.turret[1] = {r=math.rad(30),x=0,y=0,rt=math.rad(30),t=0,tl=1}
diff --git a/assets/fade.png b/assets/fade.png
new file mode 100644
index 0000000..907ec10
--- /dev/null
+++ b/assets/fade.png
Binary files differ
diff --git a/desktop.lua b/desktop.lua
index f8e4821..337aa08 100644
--- a/desktop.lua
+++ b/desktop.lua
@@ -3,12 +3,9 @@ function drawDesktop()
if desktop.bg.current ~= 0 then
love.graphics.draw(desktop.bg.current, 0, 0, 0, sys.w/1920, sys.h/1280)
end
- if scene == 2 and v1.c.chat.msgs > 35 then
- drawTentacles()
- removeTentacles()
- end
if v1.explodeintro == true and v1.yes == true then
if expl.frame >= 20 or v1.c.chat.msgs > 1 then
+ love.graphics.setColor(256,256,256)
love.graphics.draw(v1.scorch, win[2].x-300, win[2].y-100)
end
if expl.deb.load == false then
@@ -35,6 +32,16 @@ function drawDesktop()
expl.frame = expl.frame + 1*sys.s
end
end
+ if scene == 2 and v1.c.chat.msgs > 35 then
+ love.graphics.setColor(0,0,0,100)
+ love.graphics.draw(v1.fadeImg,v1.t.x,0,0,2,sys.h)
+ love.graphics.draw(v1.fadeImg,sys.w-v1.t.x,sys.h,math.rad(180),2,sys.h)
+ drawTentacles()
+ removeTentacles()
+ love.graphics.setColor(0,0,0,235)
+ love.graphics.draw(v1.fadeImg,v1.t.x,0,0,2,sys.h)
+ love.graphics.draw(v1.fadeImg,sys.w-v1.t.x,sys.h,math.rad(180),2,sys.h)
+ end
for i=1,6 do
drawIcon(i)
checkIcon(i)
@@ -77,33 +84,78 @@ function checkIcon(id)
end
end
function addTentacle(x,y,s,sp,dy,d,rl,sy)
- table.insert(v1.t.t, 1, {x=x,y=y,s=s,sy=sy,sp=sp,dy=dy,d=d,rl=rl,t=math.random(1,2),r=0,rm=false})
+ table.insert(v1.t.t, 1, {x=x,y=y,s=s,sy=sy,sp=sp,dy=dy,d=d,rl=rl,t=math.random(1,2),
+ r=0,rm=false,si=math.random(0,1),rup=math.random(0,1),syl=math.random(1,3),syc=0,syp=math.random(0,1)})
end
function drawTentacles()
+ love.graphics.setColor(256,256,256)
v1.t.time = v1.t.time - delta
- if v1.t.x <= 0 then
- v1.t.x = v1.t.x + delta*2
- elseif v1.t.x > 0 then
- v1.t.x = 0
+ if v1.t.x <= -30 then
+ v1.t.x = v1.t.x + delta*4
+ elseif v1.t.x > -30 then
+ v1.t.x = -30
end
if v1.t.time <= 0 then
- v1.t.time = 0.5
- addTentacle(math.random(-20,0),sys.h+200,math.random(3,6),
- math.random(2,6),-100,true,math.random(5,45),math.random(4,6))
+ v1.t.time = 0.3
+ addTentacle(math.random(-20,0),sys.h+300,math.random(6,10),
+ math.random(2,6),-300,true,math.random(5,45),math.random(6,10))
+ addTentacle(math.random(-20,0),-300,math.random(6,10),
+ math.random(2,6),sys.h+300,false,math.random(2,20),math.random(6,10))
end
for i=1,#v1.t.t do
- if v1.t.t[i].t == 1 then
- love.graphics.draw(v1.tent1,v1.t.t[i].x+v1.t.x,v1.t.t[i].y,math.rad(-90),v1.t.t[i].s,v1.t.t[i].sy)
- elseif v1.t.t[i].t == 2 then
- love.graphics.draw(v1.tent2,v1.t.t[i].x+v1.t.x,v1.t.t[i].y,math.rad(-90),v1.t.t[i].s,v1.t.t[i].sy)
+ if v1.t.t[i].syp == 0 and v1.c.chat.msgs <= 40 then
+ if v1.t.t[i].syc <= v1.t.t[i].syl then
+ v1.t.t[i].syc = v1.t.t[i].syc + math.random(0.1,0.02,0.05,0.01,0.08,0.065)+((v1.t.t[i].syl-v1.t.t[i].syc)/10)
+ elseif v1.t.t[i].syc > v1.t.t[i].syl then
+ v1.t.t[i].syp = 1
+ v1.t.t[i].syl = math.random(0,3)
+ end
+ elseif v1.t.t[i].syp == 1 and v1.c.chat.msgs <= 40 then
+ if v1.t.t[i].syc >= -v1.t.t[i].syl then
+ v1.t.t[i].syc = v1.t.t[i].syc - math.random(0.1,0.2,0.05,0.01,0.08,0.065)+((-v1.t.t[i].syl-v1.t.t[i].syc)/10)
+ elseif v1.t.t[i].r < -v1.t.t[i].syl then
+ v1.t.t[i].syp = 0
+ v1.t.t[i].syl = math.random(0,3)
+ end
end
- if v1.t.t[i].d == false then
+ if v1.t.t[i].rup == 0 and v1.c.chat.msgs <= 40 then
+ if v1.t.t[i].r <= v1.t.t[i].rl then
+ v1.t.t[i].r = v1.t.t[i].r + math.random(0.1,0.2,0.3,0.4,0.5,1,2)+((v1.t.t[i].rl-v1.t.t[i].r)/10)
+ elseif v1.t.t[i].r > v1.t.t[i].rl then
+ v1.t.t[i].rup = 1
+ v1.t.t[i].rl = math.random(2,20)
+ end
+ elseif v1.t.t[i].rup == 1 and v1.c.chat.msgs <= 40 then
+ if v1.t.t[i].r >= -v1.t.t[i].rl then
+ v1.t.t[i].r = v1.t.t[i].r - math.random(0.1,0.2,0.3,0.4,0.5,1,2)+((-v1.t.t[i].rl-v1.t.t[i].r)/10)
+ elseif v1.t.t[i].r < -v1.t.t[i].rl then
+ v1.t.t[i].rup = 0
+ v1.t.t[i].rl = math.random(2,20)
+ end
+ end
+ if v1.t.t[i].si == 0 then
+ if v1.t.t[i].t == 1 then
+ love.graphics.draw(v1.tent1,v1.t.t[i].x+v1.t.x,v1.t.t[i].y,math.rad(-90+v1.t.t[i].r),v1.t.t[i].s,v1.t.t[i].sy+v1.t.t[i].syc,16)
+ elseif v1.t.t[i].t == 2 then
+ love.graphics.draw(v1.tent2,v1.t.t[i].x+v1.t.x,v1.t.t[i].y,math.rad(-90+v1.t.t[i].r),v1.t.t[i].s,v1.t.t[i].sy+v1.t.t[i].syc,16)
+ end
+ elseif v1.t.t[i].si == 1 then
+ if v1.t.t[i].t == 1 then
+ love.graphics.draw(v1.tent1,(-v1.t.t[i].x)+(sys.w-v1.t.x),v1.t.t[i].y,math.rad(90+v1.t.t[i].r),v1.t.t[i].s,v1.t.t[i].sy+v1.t.t[i].syc,16)
+ elseif v1.t.t[i].t == 2 then
+ love.graphics.draw(v1.tent2,(-v1.t.t[i].x)+(sys.w-v1.t.x),v1.t.t[i].y,math.rad(90+v1.t.t[i].r),v1.t.t[i].s,v1.t.t[i].sy+v1.t.t[i].syc,16)
+ end
+ end
+ if v1.t.t[i].d == false and v1.c.chat.msgs <= 40 then
v1.t.t[i].y = v1.t.t[i].y + v1.t.t[i].sp
- else
+ if v1.t.t[i].y >= v1.t.t[i].dy then
+ v1.t.t[i].rm = true
+ end
+ elseif v1.t.t[i].d == false and v1.c.chat.msgs <= 40 then
v1.t.t[i].y = v1.t.t[i].y - v1.t.t[i].sp
- end
- if v1.t.t[i].y <= v1.t.t[i].dy then
- v1.t.t[i].rm = true
+ if v1.t.t[i].y <= v1.t.t[i].dy then
+ v1.t.t[i].rm = true
+ end
end
end
end
diff --git a/var.lua b/var.lua
index fd27bb2..1612f01 100644
--- a/var.lua
+++ b/var.lua
@@ -173,7 +173,7 @@ function loadVar()
v1.t = {}
v1.t.time = 0
v1.t.t = {}
- v1.t.x = -500
+ v1.t.x = -1000
expl.deb[1].x = 0
expl.deb[1].y = 0
expl.deb[1].ym = 5