fan背景完善
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
local gc=love.graphics
|
local gc=love.graphics
|
||||||
local int,ceil,rnd,abs=math.floor,math.ceil,math.random,math.abs
|
local int,ceil,rnd,abs=math.floor,math.ceil,math.random,math.abs
|
||||||
local max,min,sin,cos=math.max,math.min,math.sin,math.cos
|
local max,min,sin,cos=math.max,math.min,math.sin,math.cos
|
||||||
|
local ins,rem=table.insert,table.remove
|
||||||
|
|
||||||
local BG
|
local BG
|
||||||
local scr=scr
|
local scr=scr
|
||||||
@@ -124,20 +125,47 @@ back.wing={
|
|||||||
B.va=B.va-.001*level*(1+rnd())
|
B.va=B.va-.001*level*(1+rnd())
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
discard=function()
|
||||||
|
bar,crystal=nil
|
||||||
|
end,
|
||||||
}--Flandre's wing
|
}--Flandre's wing
|
||||||
|
|
||||||
local _
|
local _
|
||||||
back.fan={
|
back.fan={
|
||||||
init=function()
|
init=function()
|
||||||
L=_G.title_fan
|
fan=_G.title_fan
|
||||||
t=0
|
t=0
|
||||||
|
petal={}
|
||||||
BG.resize()
|
BG.resize()
|
||||||
end,
|
end,
|
||||||
resize=function()
|
resize=function()
|
||||||
CX,CY=scr.w/2,scr.h/2
|
CX,CY=scr.w/2,scr.h/2
|
||||||
|
W,H=scr.w,scr.h
|
||||||
end,
|
end,
|
||||||
update=function()
|
update=function()
|
||||||
t=t+1
|
t=t+1
|
||||||
|
if t%10==0 then
|
||||||
|
ins(petal,{
|
||||||
|
x=scr.w*rnd(),
|
||||||
|
y=0,
|
||||||
|
vy=2+rnd()*2,
|
||||||
|
vx=rnd()*2-.5,
|
||||||
|
rx=4+rnd()*4,
|
||||||
|
ry=4+rnd()*4,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
for i=#petal,1,-1 do
|
||||||
|
local P=petal[i]
|
||||||
|
P.y=P.y+P.vy
|
||||||
|
if P.y>H then
|
||||||
|
rem(petal,i)
|
||||||
|
else
|
||||||
|
P.x=P.x+P.vx
|
||||||
|
P.vx=P.vx+rnd()*.01
|
||||||
|
P.rx=max(min(P.rx+rnd()-.5,10),2)
|
||||||
|
P.ry=max(min(P.ry+rnd()-.5,10),2)
|
||||||
|
end
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
draw=function()
|
draw=function()
|
||||||
gc.push("transform")
|
gc.push("transform")
|
||||||
@@ -157,13 +185,23 @@ back.fan={
|
|||||||
|
|
||||||
gc.setLineWidth(6)
|
gc.setLineWidth(6)
|
||||||
gc.setColor(.55,.5,.6)
|
gc.setColor(.55,.5,.6)
|
||||||
local L=L
|
local F=fan
|
||||||
for i=1,8 do
|
for i=1,8 do
|
||||||
gc.polygon("line",L[i])
|
gc.polygon("line",F[i])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
gc.setLineWidth(2)
|
||||||
|
gc.setColor(.6,.3,.5)
|
||||||
|
gc.origin()
|
||||||
|
for i=1,#petal do
|
||||||
|
local P=petal[i]
|
||||||
|
gc.ellipse("fill",P.x,P.y,P.rx,P.ry)
|
||||||
|
end
|
||||||
gc.pop()
|
gc.pop()
|
||||||
end,
|
end,
|
||||||
|
discard=function()
|
||||||
|
petal=nil
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
back.aura={
|
back.aura={
|
||||||
|
|||||||
Reference in New Issue
Block a user