新增灯笼背景

This commit is contained in:
MrZ626
2021-03-03 16:48:25 +08:00
parent 7587d8cafd
commit e9d6778cde
8 changed files with 59 additions and 1 deletions

View File

@@ -157,6 +157,15 @@ IMG.init{
electric="mess/electric.png",
hbm="mess/hbm.png",
lanterns={
"lanterns/1.png",
"lanterns/2.png",
"lanterns/3.png",
"lanterns/4.png",
"lanterns/5.png",
"lanterns/6.png",
},
}
SKIN.init{
"crystal_scf",
@@ -328,7 +337,7 @@ do
end
end
if STAT.version<1301 then
if STAT.version<1302 then
fs.remove("conf/user")
NOGAME=true
end

BIN
media/image/lanterns/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
media/image/lanterns/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

BIN
media/image/lanterns/3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

BIN
media/image/lanterns/4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
media/image/lanterns/5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

BIN
media/image/lanterns/6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@@ -0,0 +1,49 @@
--Cool liquid background
local gc=love.graphics
local int,rnd=math.floor,math.random
local ins,rem=table.insert,table.remove
local back={}
local lanterns
local t
function back.init()
lanterns={}
t=0
end
function back.update(dt)
t=t-dt
local H=SCR.h
if t<=0 then
local size=SCR.rad*(2+rnd()*3)/5/2000
local L={
x=SCR.w*rnd(),
y=H*1.05,
vy=size*2,
size=size,
phase=rnd(),
vp=.02+.02*rnd(),
}
ins(lanterns,L)
t=rnd(.626,1.626)
end
for i=#lanterns,1,-1 do
local L=lanterns[i]
L.y=L.y-L.vy*dt*60
L.phase=(L.phase+L.vp*dt*60)%1
if L.y<.05*H then
rem(lanterns,i)
end
end
end
function back.draw()
gc.clear(.1,.1,.1)
gc.push("transform")
gc.origin()
gc.setColor(1,1,1)
for i=1,#lanterns do
local L=lanterns[i]
mDraw(IMG.lanterns[int(L.phase*6)+1],L.x,L.y,nil,L.size)
end
gc.pop()
end
return back