重构背景系统(每个背景使用独立文件),全局变量名整理
This commit is contained in:
17
parts/backgrounds/glow.lua
Normal file
17
parts/backgrounds/glow.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
--Light-dark
|
||||
local gc=love.graphics
|
||||
local rnd,sin=math.random,math.sin
|
||||
local back={}
|
||||
|
||||
local t
|
||||
function back.init()
|
||||
t=rnd()*2600
|
||||
end
|
||||
function back.update(dt)
|
||||
t=t+dt
|
||||
end
|
||||
function back.draw()
|
||||
local t1=(sin(t*.5)+sin(t*.7)+sin(t*.9+1)+sin(t*1.5)+sin(t*2+10))*.08
|
||||
gc.clear(t1,t1,t1)
|
||||
end
|
||||
return back
|
||||
Reference in New Issue
Block a user