aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris B <1029chris@gmail.com>2016-06-10 19:44:26 -0700
committerChris B <1029chris@gmail.com>2016-06-10 19:44:26 -0700
commit4ec720afe5e2f712e5f73d79a6540e7feb29d482 (patch)
tree98a94d628b7a317814524572da93a3b61269a544
parentc805934fb03808baeb688d3f629701b171b38873 (diff)
Fixed weird glitches
-rw-r--r--desktop.lua12
-rw-r--r--internet.lua2
-rw-r--r--main.lua4
-rw-r--r--viewer.lua14
-rw-r--r--virus1.lua30
-rw-r--r--window.lua8
6 files changed, 39 insertions, 31 deletions
diff --git a/desktop.lua b/desktop.lua
index d0f4979..89702c3 100644
--- a/desktop.lua
+++ b/desktop.lua
@@ -19,16 +19,16 @@ function drawDesktop()
if expl.deb[1].y < sys.h or expl.deb[2].y < sys.h or expl.deb[3].y < sys.h then
for i=1,3 do
love.graphics.draw(expl.deb[i].pic, expl.deb[i].x, expl.deb[i].y, expl.deb[i].r)
- expl.deb[i].y = expl.deb[i].y - expl.deb[i].ym
- expl.deb[i].ym = expl.deb[i].ym - 1
- expl.deb[i].x = expl.deb[i].x + expl.deb[i].xm
- expl.deb[i].r = expl.deb[i].r + expl.deb[i].rm
+ expl.deb[i].y = expl.deb[i].y - (expl.deb[i].ym*sys.s)
+ expl.deb[i].ym = expl.deb[i].ym - (1*sys.s)
+ expl.deb[i].x = expl.deb[i].x + (expl.deb[i].xm*sys.s)
+ expl.deb[i].r = expl.deb[i].r + (expl.deb[i].rm*sys.s)
end
end
if expl.frame <= 89 and v1.c.chat.msgs < 2 then
love.graphics.setColor(255,255,255)
- love.graphics.draw(expl.pic, expl.frames[expl.frame], win[2].x-750, win[2].y-500, 0, 7, 7)
- expl.frame = expl.frame + 1
+ love.graphics.draw(expl.pic, expl.frames[math.floor(expl.frame)], win[2].x-750, win[2].y-500, 0, 7, 7)
+ expl.frame = expl.frame + 1*sys.s
end
end
for i=1,6 do
diff --git a/internet.lua b/internet.lua
index 0539fcd..78a5f7b 100644
--- a/internet.lua
+++ b/internet.lua
@@ -54,7 +54,7 @@ function updateInternet()
end
if internet.load ~= 442 then
if math.random(1,3) == 3 then
- internet.load = internet.load + math.random(0,20)
+ internet.load = internet.load + (math.random(0,20)*sys.s)
win[2].update = true
end
end
diff --git a/main.lua b/main.lua
index dad4fa1..d12e583 100644
--- a/main.lua
+++ b/main.lua
@@ -42,9 +42,9 @@ function love.update(dt)
win[i].update = true
end
end
- if fade == 1 and fadeOpacity ~= 255 then
+ if fade == 1 and fadeOpacity < 255 then
fadeOpacity = fadeOpacity + 5
- elseif fade == 0 and fadeOpacity ~= 0 then
+ elseif fade == 0 and fadeOpacity > 0 then
fadeOpacity = fadeOpacity - 5
end
if scene == 1 then
diff --git a/viewer.lua b/viewer.lua
index 1a0221a..e5021e2 100644
--- a/viewer.lua
+++ b/viewer.lua
@@ -33,10 +33,18 @@ function drawMusic()
mplay.bar[i].ht = 20
else
if mplay.bar[i].h > mplay.bar[i].ht then
- mplay.bar[i].h = mplay.bar[i].h - 1
+ if mplay.bar[i].h - (1*sys.s) < mplay.bar[i].ht then
+ mplay.bar[i].h = mplay.bar[i].ht
+ else
+ mplay.bar[i].h = mplay.bar[i].h - (1*sys.s)
+ end
elseif mplay.bar[i].h < mplay.bar[i].ht then
- mplay.bar[i].h = mplay.bar[i].h + 1
- elseif mplay.bar[i].h == mplay.bar[i].ht then
+ if mplay.bar[i].h + (1*sys.s) > mplay.bar[i].ht then
+ mplay.bar[i].h = mplay.bar[i].ht
+ else
+ mplay.bar[i].h = mplay.bar[i].h + (1*sys.s)
+ end
+ elseif math.floor(mplay.bar[i].h) == mplay.bar[i].ht then
mplay.bar[i].ht = math.random(0,40)
end
love.graphics.rectangle("fill",(23*i)-13,33,21,mplay.bar[i].h)
diff --git a/virus1.lua b/virus1.lua
index 56abf0f..6e0ff94 100644
--- a/virus1.lua
+++ b/virus1.lua
@@ -11,8 +11,8 @@ function drawVirusFight1()
win[2].y+math.random(v1.shakemin,v1.shakemax), 0, 1, 1, 0, 0,
math.rad(math.random(v1.shakemin/10,v1.shakemax/10)),
math.rad(math.random(v1.shakemin/10,v1.shakemax/10)))
- v1.shakemin = v1.shakemin - 0.1
- v1.shakemax = v1.shakemax + 0.1
+ v1.shakemin = v1.shakemin - (0.1*sys.s)
+ v1.shakemax = v1.shakemax + (0.1*sys.s)
end
if v1.explodeintrotimer >= 7.7 then
v1.explodeintro = true
@@ -211,8 +211,8 @@ function drawVirusFight1()
end
if expl.frame <= 89 and v1.c.health < 25 then
love.graphics.setColor(255,255,255)
- love.graphics.draw(expl.pic, expl.frames[expl.frame], v1.c.x-615/2-800, v1.c.y-100+20-700, 0, 7, 7)
- expl.frame = expl.frame + 1
+ love.graphics.draw(expl.pic, expl.frames[math.floor(expl.frame)], v1.c.x-615/2-800, v1.c.y-100+20-700, 0, 7, 7)
+ expl.frame = expl.frame + (1*sys.s)
v1.explosionSound:play()
end
if v1.c.chat.msgs == 2 then
@@ -490,8 +490,8 @@ function drawVirusFight1()
if win[2].y+v1.c.slime.y >= v1.c.monitorspin.y then
playAnimation(v1.c.slime, true, win[2].x+v1.c.slime.x+math.random(1,4), win[2].y+v1.c.slime.y+math.random(1,4), 0, 2.5, 25, 25, 0.5)
playAnimation(v1.c.monitorspin, true, win[2].x+v1.c.monitorspin.x, v1.c.monitorspin.y, 0, 1, 100, 100, v1.c.monitorspin.sp)
- v1.c.slime.y = v1.c.slime.y - 0.5
- v1.c.monitorspin.y = v1.c.monitorspin.y + 1.5
+ v1.c.slime.y = v1.c.slime.y - 0.5*sys.s
+ v1.c.monitorspin.y = v1.c.monitorspin.y + 1.5*sys.s
end
if win[2].y+v1.c.slime.y <= v1.c.monitorspin.y+100 and v1.c.shine.s > -70 then
love.graphics.setColor(255,255,255,v1.c.shine.opa)
@@ -503,10 +503,10 @@ function drawVirusFight1()
v1.c.shine.r2, (3+v1.c.shine.s2/10)+v1.c.shine.s/10, (3+v1.c.shine.s2/10)+v1.c.shine.s/10, 100, 100)
love.graphics.draw(v1.c.shine.f1, win[2].x+v1.c.monitorspin.x, v1.c.monitorspin.y,
v1.c.shine.r1, (3+v1.c.shine.s1/10)+v1.c.shine.s/10, (3+v1.c.shine.s1/10)+v1.c.shine.s/10, 100, 100)
- v1.c.shine.r1 = v1.c.shine.r1 + math.rad(1)
- v1.c.shine.r2 = v1.c.shine.r2 - math.rad(1)
+ v1.c.shine.r1 = v1.c.shine.r1 + (math.rad(1)*sys.s)
+ v1.c.shine.r2 = v1.c.shine.r2 - (math.rad(1)*sys.s)
if v1.c.monitorspin.sp ~= 1 then
- v1.c.monitorspin.sp = v1.c.monitorspin.sp + 0.1
+ v1.c.monitorspin.sp = v1.c.monitorspin.sp + 0.1*sys.s
if v1.c.monitorspin.sp >= 1 then
v1.c.monitorspin.sp = 1
end
@@ -523,7 +523,7 @@ function drawVirusFight1()
end
if v1.c.shine.s1 >= 7 or v1.c.shine.ct >= 3 then
v1.c.shine.sm1 = false
- v1.c.shine.ct = v1.c.shine.ct + 1
+ v1.c.shine.ct = v1.c.shine.ct + 1*sys.s
elseif v1.c.shine.s1 <= -5 and v1.c.shine.ct < 3 then
v1.c.shine.sm1 = true
end
@@ -533,10 +533,10 @@ function drawVirusFight1()
v1.c.shine.sm2 = true
end
if v1.c.shine.ct <= 3 and v1.c.shine.s < 4 then
- v1.c.shine.s = v1.c.shine.s + 0.2
+ v1.c.shine.s = v1.c.shine.s + 0.2*sys.s
elseif v1.c.shine.ct >= 3 and v1.c.shine.s > -80 then
- v1.c.shine.s = v1.c.shine.s - 0.5
- v1.c.shine.opa = v1.c.shine.opa - 5
+ v1.c.shine.s = v1.c.shine.s - 0.5*sys.s
+ v1.c.shine.opa = v1.c.shine.opa - 5*sys.s
end
end
if v1.timer < 20 then
@@ -557,8 +557,8 @@ function drawVirusFight1()
v1.complete = true
end
love.graphics.setColor(255,255,255)
- love.graphics.draw(expl.pic, expl.frames[v1.explodeEndFrame], v1.c.x-615/2-800, v1.c.y-100+20-700, 0, 7, 7)
- v1.explodeEndFrame = v1.explodeEndFrame + 1
+ love.graphics.draw(expl.pic, expl.frames[math.floor(v1.explodeEndFrame)], v1.c.x-615/2-800, v1.c.y-100+20-700, 0, 7, 7)
+ v1.explodeEndFrame = v1.explodeEndFrame + 1*sys.s
v1.explosionSound:play()
v1.rumbleLoop:stop()
if v1.explodeEndFrame >= 20 then
diff --git a/window.lua b/window.lua
index a0afc7a..b7a2034 100644
--- a/window.lua
+++ b/window.lua
@@ -151,9 +151,9 @@ function drawWindow(id)
end
if id == 4 and win[4].crazy == true then
if win[4].crazyLeft == true and win[4].x >= 100 then
- win[4].x = win[4].x - 10+v1.spm*sys.s
+ win[4].x = win[4].x - (10+v1.spm)*sys.s
elseif win[4].crazyLeft == false and win[4].x <= sys.w-300 then
- win[4].x = win[4].x + 10+v1.spm*sys.s
+ win[4].x = win[4].x + (10+v1.spm)*sys.s
end
if win[4].x <= 150 then
win[4].crazyLeft = false
@@ -161,9 +161,9 @@ function drawWindow(id)
win[4].crazyLeft = true
end
if win[4].crazyUp == true and win[4].y >= sys.h/2+50 then
- win[4].y = win[4].y - 6+v1.spm*sys.s
+ win[4].y = win[4].y - (6+v1.spm)*sys.s
elseif win[4].crazyUp == false and win[4].y <= sys.h-panel.thick-200 then
- win[4].y = win[4].y + 6+v1.spm*sys.s
+ win[4].y = win[4].y + (6+v1.spm)*sys.s
end
if win[4].y <= sys.h/2+50 then
win[4].crazyUp = false