整理代码,test场景可以退出了
This commit is contained in:
@@ -524,7 +524,6 @@ function love.run()
|
|||||||
|
|
||||||
local TEXTURE,TIME=TEXTURE,TIME
|
local TEXTURE,TIME=TEXTURE,TIME
|
||||||
local SETTING,VERSION=SETTING,VERSION
|
local SETTING,VERSION=SETTING,VERSION
|
||||||
local destroyPlayers=destroyPlayers
|
|
||||||
|
|
||||||
local STEP,WAIT=love.timer.step,love.timer.sleep
|
local STEP,WAIT=love.timer.step,love.timer.sleep
|
||||||
local FPS,MINI=love.timer.getFPS,love.window.isMinimized
|
local FPS,MINI=love.timer.getFPS,love.window.isMinimized
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ function scene.sceneInit()
|
|||||||
noKey=GAME.replaying
|
noKey=GAME.replaying
|
||||||
noTouch=not SETTING.VKSwitch or noKey
|
noTouch=not SETTING.VKSwitch or noKey
|
||||||
end
|
end
|
||||||
|
function scene.sceneBack()
|
||||||
|
love.keyboard.setKeyRepeat(true)
|
||||||
|
destroyPlayers()
|
||||||
|
end
|
||||||
|
|
||||||
scene.mouseDown=NULL
|
scene.mouseDown=NULL
|
||||||
local function restart()
|
local function restart()
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ local scene={}
|
|||||||
|
|
||||||
function scene.sceneInit(org)
|
function scene.sceneInit(org)
|
||||||
BG.set()
|
BG.set()
|
||||||
destroyPlayers()
|
|
||||||
mapCam.zoomK=org=='main'and 5 or 1
|
mapCam.zoomK=org=='main'and 5 or 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -219,7 +219,6 @@ function scene.socketRead(cmd,d)
|
|||||||
end
|
end
|
||||||
elseif cmd=='finish'then
|
elseif cmd=='finish'then
|
||||||
playing=false
|
playing=false
|
||||||
love.keyboard.setKeyRepeat(true)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ local ins,rem=table.insert,table.remove
|
|||||||
|
|
||||||
local scene={}
|
local scene={}
|
||||||
|
|
||||||
|
local backCounter
|
||||||
local list,timer
|
local list,timer
|
||||||
local function push(mes)
|
local function push(mes)
|
||||||
ins(list,{mes,120})
|
ins(list,{mes,120})
|
||||||
@@ -10,13 +11,14 @@ local function push(mes)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function scene.sceneInit()
|
function scene.sceneInit()
|
||||||
|
backCounter=5
|
||||||
list={}
|
list={}
|
||||||
timer=0
|
timer=0
|
||||||
love.keyboard.setKeyRepeat(false)
|
love.keyboard.setKeyRepeat(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
function scene.sceneBack()
|
function scene.sceneBack()
|
||||||
list=nil
|
list={}
|
||||||
love.keyboard.setKeyRepeat(true)
|
love.keyboard.setKeyRepeat(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -28,6 +30,14 @@ function scene.gamepadUp(key)
|
|||||||
end
|
end
|
||||||
function scene.keyDown(key)
|
function scene.keyDown(key)
|
||||||
push("[keyDown] <"..key..">")
|
push("[keyDown] <"..key..">")
|
||||||
|
if key=="escape"then
|
||||||
|
backCounter=backCounter-1
|
||||||
|
if backCounter==0 then
|
||||||
|
SCN.back()
|
||||||
|
else
|
||||||
|
LOG.print(backCounter)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
function scene.keyUp(key)
|
function scene.keyUp(key)
|
||||||
push{COLOR.H,"[keyUp] <"..key..">"}
|
push{COLOR.H,"[keyUp] <"..key..">"}
|
||||||
|
|||||||
Reference in New Issue
Block a user