微调取消暂停动画,添加音效

This commit is contained in:
MrZ626
2021-01-20 20:11:02 +08:00
parent 4c351cd1e1
commit 017e190e4a

View File

@@ -6,7 +6,7 @@ local scene={}
local timer
function scene.sceneInit()
timer=2
timer=1
end
scene.keyDown=NULL
@@ -14,25 +14,29 @@ scene.mouseDown=NULL
scene.touchDown=NULL
function scene.update(dt)
timer=timer-dt
timer=timer-dt*.8
if timer<0 then
SFX.play("click")
SCN.swapTo("play","none")
end
end
function scene.draw()
if timer<1 then
--Game scene
if timer*1.5<1 then
SCN.scenes.play.draw()
end
gc.setColor(.15,.15,.15,timer)
--Grey screen cover
gc.setColor(.15,.15,.15,timer*1.5)
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)
--Pie counter
gc.setColor(1,1,1,4*(1-timer))
gc.arc("fill","pie",640,360,160,-1.5708,timer*6.2832-1.5708)
end
return scene