diff options
| author | 1029chris <1029chris@gmail.com> | 2016-08-04 17:31:55 -0700 |
|---|---|---|
| committer | 1029chris <1029chris@gmail.com> | 2016-08-04 17:31:55 -0700 |
| commit | 33cce45e067eb3d716ad33b5752a838319125855 (patch) | |
| tree | 59d9fc8561c8ead0b9b8b3d5c1e6a81625ad0fed | |
| parent | cb5ee7e47850599e51da852c14698fb6135ba4d7 (diff) | |
Added drawVirus2 function
changed playAnimation to follow frames for mask
Added virus2 x,y,r,s
| -rw-r--r-- | assets.lua | 3 | ||||
| -rw-r--r-- | var.lua | 4 | ||||
| -rw-r--r-- | virus2.lua | 15 |
3 files changed, 22 insertions, 0 deletions
@@ -296,6 +296,9 @@ function loadAnimation(pic, quad, frames, limit, w, h) end end function playAnimation(ani, loop, x, y, r, s, xo, yo, sp) + if ani == v2.c.idle.mask then + ani.f = v2.c.idle.f + end if ani.fs[math.floor(ani.f)] ~= nil then love.graphics.draw(ani.pic, ani.fs[math.floor(ani.f)], x, y, r, s, s, xo, yo) end @@ -193,6 +193,10 @@ function loadVar() v2.pop.add = false v2.pop.hov = 0 v2.msgs = {} + v2.c.x = 300 + v2.c.y = 300 + v2.c.s = 1 + v2.c.r = 0 expl.deb[1].x = 0 expl.deb[1].y = 0 expl.deb[1].ym = 5 @@ -101,3 +101,18 @@ function drawPopups() v2.pop.add = false end end +function drawVirus2() + love.graphics.setColor(255,255,255) + playAnimation(v2.c.idle, true, v2.c.x, v2.c.y, v2.c.r, v2.c.s, 125, 125, 0.5) + love.graphics.stencil(drawVirus2Stencil, "replace", 1) + love.graphics.setStencilTest("greater", 0) + love.graphics.draw(v2.c.pupil, v2.c.x-26+math.random(-0.7,0.7),v2.c.y-57+math.random(-0.7,0.7),v2.c.r,v2.c.s) + love.graphics.draw(v2.c.pupil, v2.c.x+21+math.random(-0.7,0.7),v2.c.y-57+math.random(-0.7,0.7),v2.c.r,v2.c.s) + love.graphics.setStencilTest() + love.graphics.draw(v2.c.idle.hands, v2.c.x, v2.c.y, v2.c.r, v2.c.s, v2.c.s, 125, 125) +end +function drawVirus2Stencil() + love.graphics.setShader(mask_effect) + playAnimation(v2.c.idle.mask, true, v2.c.x, v2.c.y, v2.c.r, v2.c.s, 125, 125, 0.5) + love.graphics.setShader() +end |
