背景代码略微优化
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
--Bad Apple!! (128x96, 10fps, 2192f)
|
||||
local gc=love.graphics
|
||||
local rectangle=gc.rectangle
|
||||
local int=math.floor
|
||||
local back={}
|
||||
|
||||
@@ -43,7 +44,7 @@ function back.draw()
|
||||
for j=7,0,-1 do
|
||||
local p=8*i+j
|
||||
if bAnd(B,1)==0 then
|
||||
gc.rectangle("fill",p%128,int(p/128),1,1)
|
||||
rectangle("fill",p%128,int(p/128),1,1)
|
||||
end
|
||||
B=bRshift(B,1)
|
||||
end
|
||||
@@ -51,6 +52,6 @@ function back.draw()
|
||||
gc.pop()
|
||||
end
|
||||
function back.discard()
|
||||
video=false
|
||||
video=nil
|
||||
end
|
||||
return back
|
||||
@@ -1,5 +1,6 @@
|
||||
--UUZ's fan
|
||||
local gc=love.graphics
|
||||
local polygon,ellipse=gc.polygon,gc.ellipse
|
||||
local rnd=math.random
|
||||
local max,min,sin=math.max,math.min,math.sin
|
||||
local ins,rem=table.insert,table.remove
|
||||
@@ -57,7 +58,7 @@ function back.draw()
|
||||
gc.setLineWidth(6)
|
||||
gc.setColor(.55,.5,.6)
|
||||
for i=1,8 do
|
||||
gc.polygon("line",fan[i])
|
||||
polygon("line",fan[i])
|
||||
end
|
||||
|
||||
gc.setLineWidth(2)
|
||||
@@ -65,11 +66,11 @@ function back.draw()
|
||||
gc.origin()
|
||||
for i=1,#petal do
|
||||
local P=petal[i]
|
||||
gc.ellipse("fill",P.x,P.y,P.rx,P.ry)
|
||||
ellipse("fill",P.x,P.y,P.rx,P.ry)
|
||||
end
|
||||
gc.pop()
|
||||
end
|
||||
function back.discard()
|
||||
petal=false
|
||||
petal=nil
|
||||
end
|
||||
return back
|
||||
@@ -1,5 +1,6 @@
|
||||
--Snow
|
||||
local gc=love.graphics
|
||||
local ellipse=gc.ellipse
|
||||
local rnd=math.random
|
||||
local max,min=math.max,math.min
|
||||
local ins,rem=table.insert,table.remove
|
||||
@@ -44,11 +45,11 @@ function back.draw()
|
||||
gc.origin()
|
||||
for i=1,#snow do
|
||||
local P=snow[i]
|
||||
gc.ellipse("fill",P.x,P.y,P.rx,P.ry)
|
||||
ellipse("fill",P.x,P.y,P.rx,P.ry)
|
||||
end
|
||||
gc.pop()
|
||||
end
|
||||
function back.discard()
|
||||
snow=false
|
||||
snow=nil
|
||||
end
|
||||
return back
|
||||
@@ -1,5 +1,6 @@
|
||||
--Space with stars
|
||||
local gc=love.graphics
|
||||
local rectangle=gc.rectangle
|
||||
local rnd=math.random
|
||||
local back={}
|
||||
|
||||
@@ -35,14 +36,11 @@ function back.draw()
|
||||
gc.translate(-10,-10)
|
||||
gc.setColor(.8,.8,.8)
|
||||
for i=1,1260,5 do
|
||||
local s=stars
|
||||
local x,y=s[i+1],s[i+2]
|
||||
s=s[i]
|
||||
gc.rectangle("fill",x,y,s,s)
|
||||
rectangle("fill",stars[i+1],stars[i+2],stars[i],stars[i])
|
||||
end
|
||||
gc.translate(10,10)
|
||||
end
|
||||
function back.discard()
|
||||
stars=false
|
||||
stars=nil
|
||||
end
|
||||
return back
|
||||
@@ -38,6 +38,6 @@ function back.draw()
|
||||
end
|
||||
end
|
||||
function back.discard()
|
||||
ring=false
|
||||
ring=nil
|
||||
end
|
||||
return back
|
||||
@@ -68,6 +68,6 @@ function back.event(level)
|
||||
end
|
||||
end
|
||||
function back.discard()
|
||||
bar,crystal=false,false
|
||||
bar,crystal=nil
|
||||
end
|
||||
return back
|
||||
Reference in New Issue
Block a user