diff options
| author | 1029chris <1029chris@gmail.com> | 2016-04-21 21:30:58 -0700 |
|---|---|---|
| committer | 1029chris <1029chris@gmail.com> | 2016-04-21 21:30:58 -0700 |
| commit | dcf65f619aa1060d07a2470b067ecde6e02ff928 (patch) | |
| tree | 10c3a826991041323b79a87bc2e6330cdf967b33 | |
| parent | 40cff9688fb0a177c35b067c687fcac701ef60b3 (diff) | |
Added more dialogue for virus after antivirus appears
i did this using a timer that makes the messages progress
| -rw-r--r-- | assets.lua | 1 | ||||
| -rw-r--r-- | main.lua | 1 | ||||
| -rw-r--r-- | virus1.lua | 10 |
3 files changed, 9 insertions, 3 deletions
@@ -152,6 +152,7 @@ function loadAssets() v1.c.eyey = 0 v1.c.eyetx = 0 v1.c.eyety = 0 + v1.c.chat.time = 0 expl = {} expl.frames = {} expl.pic = love.graphics.newImage("assets/explosion.png") @@ -36,6 +36,7 @@ function love.load() loadDia() end function love.update(dt) + delta = dt time = time + dt sys.w = love.graphics.getWidth() sys.h = love.graphics.getHeight() @@ -50,9 +50,7 @@ function drawVirusFight1() playAnimation(v1.c.idle, true, v1.c.x+40, v1.c.y+40, v1.c.r, v1.c.s, 100, 100, 0.5) love.graphics.setColor(255,255,255) love.graphics.draw(v1.c.eye, v1.c.x-32, v1.c.y-50, v1.c.r, v1.c.s*0.9, v1.c.s*1.1) - if v1.c.chat.msgs < 3 or v1.c.chat.msgs >= 11 then - v1.c.eyex = 0 - v1.c.eyey = 0 + if v1.c.chat.msgs < 3 or v1.c.chat.msgs >= 11 or v1.c.chat.msgs == 7 then v1.c.eyetx = v1.c.x+7 v1.c.eyety = v1.c.y-28 elseif v1.c.chat.msgs >= 3 and v1.c.chat.msgs <= 7 then @@ -97,6 +95,12 @@ function drawVirusFight1() end end end + if v1.c.chat.msgs == 8 then + v1.c.chat.time = v1.c.chat.time + delta + if v1.c.chat.time > 4 then + v1.c.chat.msgs = 9 + 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 v1.c.sp = v1.c.sp*2 |
