From ae3858a6f0c154ad5bf34410b4fb1cdf45ce1c8e Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Thu, 12 Nov 2020 12:59:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E8=83=8C=E6=99=AF=EF=BC=9ATunnel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modes/GM.lua | 2 +- parts/backgrounds/tunnel.lua | 43 ++++++++++++++++++++++++++++++++++++ parts/scenes/customGame.lua | 2 +- 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 parts/backgrounds/tunnel.lua diff --git a/modes/GM.lua b/modes/GM.lua index 191222c3..ecf180b7 100644 --- a/modes/GM.lua +++ b/modes/GM.lua @@ -30,7 +30,7 @@ return{ return true end end, - bg="welcome",bgm="far", + bg="tunnel",bgm="far", }, slowMark=true, load=function() diff --git a/parts/backgrounds/tunnel.lua b/parts/backgrounds/tunnel.lua new file mode 100644 index 00000000..ef2e4859 --- /dev/null +++ b/parts/backgrounds/tunnel.lua @@ -0,0 +1,43 @@ +--Cool Tunnel +local gc=love.graphics +local rnd=math.random +local ins,rem=table.insert,table.remove +local back={} + +local ring +local t +local W,H +function back.init() + ring={} + t=26 + back.resize(SCR.w,SCR.h) +end +function back.resize(w,h) + W,H=w,h +end +function back.update(dt) + t=t-1 + if t==0 then + t=rnd(26,62) + ins(ring,0) + end + for i=#ring,1,-1 do + ring[i]=ring[i]+dt + if ring[i]>3.55 then + rem(ring,i) + end + end +end +function back.draw() + gc.clear(.1,.1,.1) + gc.setColor(.4,.4,.4) + for i=1,#ring do + local r=ring[i]^2/12 + gc.setLineWidth(30-15/(r+.5)) + gc.rectangle("line",640-W*r/2,360-H*r/2,W*r,H*r) + end +end +function back.discard() + ring=nil +end +return back \ No newline at end of file diff --git a/parts/scenes/customGame.lua b/parts/scenes/customGame.lua index 9c6039d3..adcd72b1 100644 --- a/parts/scenes/customGame.lua +++ b/parts/scenes/customGame.lua @@ -166,7 +166,7 @@ WIDGET.init("customGame",{ --Else WIDGET.newSelector({name="bg", x=1070, y=150,w=250,color="yellow", - list={"none","grey","glow","rgb","flink","wing","fan","badapple","welcome","aura","bg1","bg2","rainbow","rainbow2","lightning","lightning2","matrix","space"}, + list={"none","grey","glow","rgb","flink","wing","fan","badapple","welcome","aura","bg1","bg2","rainbow","rainbow2","tunnel","lightning","lightning2","matrix","space"}, disp=WIDGET.lnk.CUSval("bg"), code=function(i)CUSTOMENV.bg=i BG.set(i)end }),