-
Notifications
You must be signed in to change notification settings - Fork 0
/
bgranges.lua
48 lines (32 loc) · 732 Bytes
/
bgranges.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
saveBgRanges=function ()
--we save all frame numbers that have are flagged bgs
--this is a bg flag
local bgs={}
--this is end of bg range flag
local endbgs={}
for i=1,maxframe
do
if frames[i].bg==true then
table.insert(bgs,i)
end
end
love.filesystem.write(conf.prjfld..'projectbgs.lua',serialize(bgs))
end
loadBgRanges=function()
local bgs = {}
bgsFsInfo=love.filesystem.getInfo(conf.prjfld..'projectbgs.lua')
print('bgs file ')
print(bgsFsInfo)
if bgsFsInfo then
bgs=love.filesystem.load(conf.prjfld..'projectbgs.lua')()
else
-- highscores=defaulths()
print('no bgs file')
end
print(bgs)
for i,num in ipairs(bgs)
do
print('set frame '..num..' as bg')
frames[num].bg=true
end
end