From 045adaaa43f15e1987903535b969cb64bb144184 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Wed, 20 Jan 2021 00:38:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=9A=82=E5=81=9C=E4=BC=9A?= =?UTF-8?q?=E6=9C=89=E5=80=92=E8=AE=A1=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/gametoolfunc.lua | 3 --- parts/scenes/depause.lua | 38 ++++++++++++++++++++++++++++++++++++++ parts/scenes/pause.lua | 2 +- 3 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 parts/scenes/depause.lua diff --git a/parts/gametoolfunc.lua b/parts/gametoolfunc.lua index 80609f6c..f39a8180 100644 --- a/parts/gametoolfunc.lua +++ b/parts/gametoolfunc.lua @@ -451,9 +451,6 @@ function pauseGame() SCN.swapTo("pause","none") end end -function resumeGame() - SCN.swapTo("play","none") -end function applyCustomGame()--Apply CUSTOMENV, BAG, MISSION for k,v in next,CUSTOMENV do GAME.modeEnv[k]=v diff --git a/parts/scenes/depause.lua b/parts/scenes/depause.lua new file mode 100644 index 00000000..ca745615 --- /dev/null +++ b/parts/scenes/depause.lua @@ -0,0 +1,38 @@ +local gc=love.graphics +local int=math.floor + +local scene={} + +local timer + +function scene.sceneInit() + timer=2 +end + +scene.keyDown=NULL +scene.mouseDown=NULL +scene.touchDown=NULL + +function scene.update(dt) + timer=timer-dt + if timer<0 then + SCN.swapTo("play","none") + end +end + +function scene.draw() + if timer<1 then + SCN.scenes.play.draw() + end + + gc.setColor(.15,.15,.15,timer) + gc.push("transform") + gc.origin() + gc.rectangle("fill",0,0,SCR.w,SCR.h) + gc.pop() + + gc.setColor(1,1,1,5*(2-timer)) + gc.arc("fill","pie",640,360,160,-1.5708,timer*3.1416-1.5708) +end + +return scene \ No newline at end of file diff --git a/parts/scenes/pause.lua b/parts/scenes/pause.lua index b956dad5..8149c45a 100644 --- a/parts/scenes/pause.lua +++ b/parts/scenes/pause.lua @@ -134,7 +134,7 @@ function scene.keyDown(key) if key=="q"then SCN.back() elseif key=="escape"then - resumeGame() + SCN.swapTo(GAME.result and"play"or"depause","none") elseif key=="s"then GAME.prevBG=BG.cur SCN.go("setting_sound")