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