aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author1029chris <1029chris@gmail.com>2016-05-06 09:26:10 -0700
committer1029chris <1029chris@gmail.com>2016-05-06 09:26:10 -0700
commit5b26747c9b9a17f6b688e057fd880c5f3a486237 (patch)
tree810c49d7dd4ce6691daa60645b64b2aeb39cc8e7
parent53dc384da8eda60e3d428daa82042a6cbdc1462d (diff)
Added function to reload game
moved some variables from assets.lua to var.lua
-rw-r--r--assets.lua25
-rw-r--r--loading.lua4
-rw-r--r--var.lua56
3 files changed, 61 insertions, 24 deletions
diff --git a/assets.lua b/assets.lua
index 770511d..c410a2f 100644
--- a/assets.lua
+++ b/assets.lua
@@ -140,15 +140,9 @@ function loadAssets(id)
}
end
if id == 14 then
- v1.rumbleLoop:setLooping(true)
- v1.msgs = {}
v1.c = {}
v1.c.chat = {}
- v1.c.chat.next = false
- v1.c.chat.msgs = 1
- v1.c.chat.msg = ""
- v1.c.chat.sp = 0.5
- v1.c.chat.char = 0
+ 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}
v1.turret[2] = {r=math.rad(15),x=0,y=0,rt=math.rad(15),t=0,tl=2}
@@ -195,23 +189,6 @@ function loadAssets(id)
v1.c.shine.sm2 = true
v1.c.shine.ct = 0
v1.c.shine.opa = 255
- v1.c.x = 0
- v1.c.y = 0
- v1.c.s = 1
- v1.c.r = 0
- v1.c.xd = 0
- v1.c.yd = 0
- v1.c.spx = 0
- v1.c.spy = 0
- v1.c.sp = 1
- v1.c.angle = 0
- v1.c.load = false
- v1.c.eyex = 0
- v1.c.eyey = 0
- v1.c.eyetx = 0
- v1.c.eyety = 0
- v1.c.chat.time = 0
- v1.c.health = 100
end
if id == 15 then
expl = {}
diff --git a/loading.lua b/loading.lua
index a322685..5596649 100644
--- a/loading.lua
+++ b/loading.lua
@@ -25,7 +25,11 @@ function drawLoading()
end
end
function drawBSOD()
+ love.audio.stop()
love.graphics.setBackgroundColor(0,0,120)
love.graphics.setColor(256,256,256)
love.graphics.draw(bsod.pic, sys.w/2, sys.h/2, 0, 1, 1, 320, 200)
+ if love.keyboard.isDown("return") == true then
+ loadRe()
+ end
end
diff --git a/var.lua b/var.lua
index 16d0f94..b87e9b2 100644
--- a/var.lua
+++ b/var.lua
@@ -137,6 +137,29 @@ function loadVar()
v1.explodeEndFrame = 1
v1.complete = false
v1.fightMinute = 5
+ v1.c.x = 0
+ v1.c.y = 0
+ v1.c.s = 1
+ v1.c.r = 0
+ v1.c.xd = 0
+ v1.c.yd = 0
+ v1.c.spx = 0
+ v1.c.spy = 0
+ v1.c.sp = 1
+ v1.c.angle = 0
+ v1.c.load = false
+ v1.c.eyex = 0
+ v1.c.eyey = 0
+ v1.c.eyetx = 0
+ v1.c.eyety = 0
+ v1.c.chat.time = 0
+ v1.c.health = 100
+ v1.msgs = {}
+ v1.c.chat.next = false
+ v1.c.chat.msgs = 1
+ v1.c.chat.msg = ""
+ v1.c.chat.sp = 0.5
+ v1.c.chat.char = 0
expl.deb[1].x = 0
expl.deb[1].y = 0
expl.deb[1].ym = 5
@@ -214,3 +237,36 @@ function loadPre()
sys.w = love.graphics.getWidth()
sys.h = love.graphics.getHeight()
end
+function loadRe()
+ loading = 0
+ fade = 0
+ loaded = true
+ loadingId = 1
+ time = 0
+ fadeOpacity = 0
+ v1.c.monitorspin.f = 1
+ v1.c.monitorspin.x = 330
+ v1.c.monitorspin.y = -200
+ v1.c.monitorspin.sp = 0.4
+ v1.c.slime.f = 1
+ v1.c.slime.x = 330
+ v1.c.slime.y = 350
+ v1.c.shine.r1 = 0
+ v1.c.shine.r2 = 0
+ v1.c.shine.s1 = 0
+ v1.c.shine.s2 = 0
+ v1.c.shine.s = -25
+ v1.c.shine.sm1 = true
+ v1.c.shine.sm2 = true
+ v1.c.shine.ct = 0
+ v1.c.shine.opa = 255
+ v1.c.idle.f = 1
+ v1.turret[1] = {r=math.rad(30),x=0,y=0,rt=math.rad(30),t=0,tl=1}
+ v1.turret[2] = {r=math.rad(15),x=0,y=0,rt=math.rad(15),t=0,tl=2}
+ v1.turret[3] = {r=math.rad(-15),x=0,y=0,rt=math.rad(-15),t=0,tl=3}
+ v1.turret[4] = {r=math.rad(-30),x=0,y=0,rt=math.rad(-30),t=0,tl=4}
+ expl.frame = 1
+ loadVar()
+ loadDia()
+ scene = 0
+end