代码规范:把所有的tab换成空格
This commit is contained in:
@@ -14,66 +14,66 @@ local back={}
|
||||
local t
|
||||
local fan,petal
|
||||
function back.init()
|
||||
t=0
|
||||
fan=title_fan
|
||||
petal={}
|
||||
t=0
|
||||
fan=title_fan
|
||||
petal={}
|
||||
end
|
||||
function back.update()
|
||||
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>SCR.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
|
||||
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>SCR.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
|
||||
function back.draw()
|
||||
gc_clear(.1,.1,.1)
|
||||
gc_clear(.1,.1,.1)
|
||||
|
||||
gc_replaceTransform(SCR.xOy_m)
|
||||
gc_translate(0,20*sin(t*.02))
|
||||
gc_replaceTransform(SCR.xOy_m)
|
||||
gc_translate(0,20*sin(t*.02))
|
||||
|
||||
gc_setLineWidth(320)
|
||||
gc_setColor(.9,.6,.9,.1)
|
||||
gc_arc('line','open',0,420,500,-.8*3.1416,-.2*3.1416)
|
||||
gc_setLineWidth(320)
|
||||
gc_setColor(.9,.6,.9,.1)
|
||||
gc_arc('line','open',0,420,500,-.8*3.1416,-.2*3.1416)
|
||||
|
||||
gc_setLineWidth(4)
|
||||
gc_setColor(1,.7,.9,.2)
|
||||
gc_arc('line','open',0,420,660,-.799*3.1416,-.201*3.1416)
|
||||
gc_arc('line','open',0,420,340,-.808*3.1416,-.192*3.1416)
|
||||
gc_line(-281,224,-530,30.5)
|
||||
gc_line(281,224,530,30.5)
|
||||
gc_setLineWidth(4)
|
||||
gc_setColor(1,.7,.9,.2)
|
||||
gc_arc('line','open',0,420,660,-.799*3.1416,-.201*3.1416)
|
||||
gc_arc('line','open',0,420,340,-.808*3.1416,-.192*3.1416)
|
||||
gc_line(-281,224,-530,30.5)
|
||||
gc_line(281,224,530,30.5)
|
||||
|
||||
gc_setLineWidth(6)
|
||||
gc_setColor(.8,.9,1,.3)
|
||||
for i=1,8 do gc_polygon('line',fan[i])end
|
||||
gc_setLineWidth(6)
|
||||
gc_setColor(.8,.9,1,.3)
|
||||
for i=1,8 do gc_polygon('line',fan[i])end
|
||||
|
||||
gc_setLineWidth(2)
|
||||
gc_setColor(1,.5,.7,.3)
|
||||
gc_setLineWidth(2)
|
||||
gc_setColor(1,.5,.7,.3)
|
||||
|
||||
gc_origin()
|
||||
for i=1,#petal do
|
||||
local P=petal[i]
|
||||
gc_ellipse('fill',P.x,P.y,P.rx,P.ry)
|
||||
end
|
||||
gc_origin()
|
||||
for i=1,#petal do
|
||||
local P=petal[i]
|
||||
gc_ellipse('fill',P.x,P.y,P.rx,P.ry)
|
||||
end
|
||||
end
|
||||
function back.discard()
|
||||
petal=nil
|
||||
petal=nil
|
||||
end
|
||||
return back
|
||||
Reference in New Issue
Block a user