整理代码
This commit is contained in:
@@ -50,10 +50,8 @@ local function releaseKey(P,keyID)
|
|||||||
end
|
end
|
||||||
local function pressKey_Rec(P,keyID)
|
local function pressKey_Rec(P,keyID)
|
||||||
if P.keyAvailable[keyID]then
|
if P.keyAvailable[keyID]then
|
||||||
if GAME.recording then
|
ins(GAME.rep,GAME.frame+1)
|
||||||
ins(GAME.rep,GAME.frame+1)
|
ins(GAME.rep,keyID)
|
||||||
ins(GAME.rep,keyID)
|
|
||||||
end
|
|
||||||
P.keyPressing[keyID]=true
|
P.keyPressing[keyID]=true
|
||||||
P.actList[keyID](P)
|
P.actList[keyID](P)
|
||||||
if P.control then
|
if P.control then
|
||||||
@@ -66,10 +64,8 @@ local function pressKey_Rec(P,keyID)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
local function releaseKey_Rec(P,keyID)
|
local function releaseKey_Rec(P,keyID)
|
||||||
if GAME.recording then
|
ins(GAME.rep,GAME.frame+1)
|
||||||
ins(GAME.rep,GAME.frame+1)
|
ins(GAME.rep,-keyID)
|
||||||
ins(GAME.rep,-keyID)
|
|
||||||
end
|
|
||||||
P.keyPressing[keyID]=false
|
P.keyPressing[keyID]=false
|
||||||
end
|
end
|
||||||
local function newEmptyPlayer(id,mini)
|
local function newEmptyPlayer(id,mini)
|
||||||
|
|||||||
@@ -102,7 +102,9 @@ function scene.touchMove()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function scene.keyDown(key)
|
function scene.keyDown(key)
|
||||||
if not noKey then
|
if key=="escape"then
|
||||||
|
pauseGame()
|
||||||
|
elseif not noKey then
|
||||||
local m=keyMap
|
local m=keyMap
|
||||||
for k=1,20 do
|
for k=1,20 do
|
||||||
if key==m[1][k]or key==m[2][k]then
|
if key==m[1][k]or key==m[2][k]then
|
||||||
@@ -113,7 +115,6 @@ function scene.keyDown(key)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if key=="escape"then pauseGame()end
|
|
||||||
end
|
end
|
||||||
function scene.keyUp(key)
|
function scene.keyUp(key)
|
||||||
if noKey then return end
|
if noKey then return end
|
||||||
|
|||||||
Reference in New Issue
Block a user