取消暂停会有倒计时

This commit is contained in:
MrZ626
2021-01-20 00:38:37 +08:00
parent 48e9e5e2c5
commit 045adaaa43
3 changed files with 39 additions and 4 deletions

View File

@@ -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

38
parts/scenes/depause.lua Normal file
View File

@@ -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

View File

@@ -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")