play场景改名game,整理代码,重构GAME.frame相关内容,修复联网录像播放不正确

This commit is contained in:
MrZ626
2021-04-17 01:39:18 +08:00
parent 444c5e571e
commit 287d5a805d
24 changed files with 81 additions and 98 deletions

View File

@@ -43,7 +43,7 @@ local function pressKey(P,keyID)
P.keyPressing[keyID]=true
P.actList[keyID](P)
if P.control then
ins(P.keyTime,1,GAME.frame)
ins(P.keyTime,1,P.frameRun)
P.keyTime[11]=nil
end
P.stat.key=P.stat.key+1
@@ -55,12 +55,12 @@ end
local function pressKey_Rec(P,keyID)
if P.keyAvailable[keyID]and P.alive then
local L=GAME.rep
ins(L,GAME.frame)
ins(L,P.frameRun)
ins(L,keyID)
P.keyPressing[keyID]=true
P.actList[keyID](P)
if P.control then
ins(P.keyTime,1,GAME.frame)
ins(P.keyTime,1,P.frameRun)
P.keyTime[11]=nil
end
P.stat.key=P.stat.key+1
@@ -68,7 +68,7 @@ local function pressKey_Rec(P,keyID)
end
local function releaseKey_Rec(P,keyID)
local L=GAME.rep
ins(L,GAME.frame)
ins(L,P.frameRun)
ins(L,32+keyID)
P.keyPressing[keyID]=false
end
@@ -114,6 +114,7 @@ local function newEmptyPlayer(id,mini)
P.randGen=love.math.newRandomGenerator(GAME.seed)
P.frameRun=GAME.frameStart
P.alive=true
P.control=false
P.timing=false
@@ -354,6 +355,7 @@ function PLY.newDemoPlayer(id)
P.sound=true
P.demo=true
P.frameRun=180
P.draw=PLY.draw.demo
P.control=true
GAME.modeEnv=DemoEnv