修正联网模式可以F8+F4
整理代码,游戏场景不再有自己的tasUsed变量
This commit is contained in:
@@ -234,11 +234,13 @@ local function noDevkeyPressed(key)
|
|||||||
elseif key=="f3"then
|
elseif key=="f3"then
|
||||||
MES.new('error',"挂了")
|
MES.new('error',"挂了")
|
||||||
elseif key=="f4"then
|
elseif key=="f4"then
|
||||||
for _=1,8 do
|
if GAME.playing and not GAME.net then
|
||||||
local P=PLY_ALIVE[rnd(#PLY_ALIVE)]
|
for _=1,8 do
|
||||||
if P and P~=PLAYERS[1]then
|
local P=PLY_ALIVE[rnd(#PLY_ALIVE)]
|
||||||
P.lastRecv=PLAYERS[1]
|
if P and P~=PLAYERS[1]then
|
||||||
P:lose()
|
P.lastRecv=PLAYERS[1]
|
||||||
|
P:lose()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif key=="f5"then
|
elseif key=="f5"then
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ local touchMoveLastFrame=false
|
|||||||
local floatGameRate,gameRate
|
local floatGameRate,gameRate
|
||||||
local modeTextPos
|
local modeTextPos
|
||||||
|
|
||||||
local tasMode
|
|
||||||
local replaying
|
local replaying
|
||||||
local repRateStrings={[0]="pause",[.125]="0.125x",[.5]="0.5x",[1]="1x",[2]="2x",[5]="5x"}
|
local repRateStrings={[0]="pause",[.125]="0.125x",[.5]="0.5x",[1]="1x",[2]="2x",[5]="5x"}
|
||||||
|
|
||||||
@@ -17,7 +16,7 @@ local scene={}
|
|||||||
local function _updateMenuButtons()
|
local function _updateMenuButtons()
|
||||||
WIDGET.active.restart.hide=replaying
|
WIDGET.active.restart.hide=replaying
|
||||||
|
|
||||||
local pos=(tasMode or replaying)and'right'or SETTING.menuPos
|
local pos=(GAME.tasUsed or replaying)and'right'or SETTING.menuPos
|
||||||
if GAME.replaying or pos=='right'then
|
if GAME.replaying or pos=='right'then
|
||||||
WIDGET.active.restart.x=1125
|
WIDGET.active.restart.x=1125
|
||||||
WIDGET.active.pause.x=1195
|
WIDGET.active.pause.x=1195
|
||||||
@@ -34,7 +33,7 @@ local function _updateMenuButtons()
|
|||||||
end
|
end
|
||||||
local function _updateRepButtons()
|
local function _updateRepButtons()
|
||||||
local L=scene.widgetList
|
local L=scene.widgetList
|
||||||
if replaying or tasMode then
|
if replaying or GAME.tasUsed then
|
||||||
for i=1,6 do L[i].hide=false end L[7].hide=true
|
for i=1,6 do L[i].hide=false end L[7].hide=true
|
||||||
if gameRate==0 then
|
if gameRate==0 then
|
||||||
L[1].hide=true
|
L[1].hide=true
|
||||||
@@ -107,7 +106,6 @@ local function _restart()
|
|||||||
resetGameData(PLAYERS[1].frameRun<240 and'q')
|
resetGameData(PLAYERS[1].frameRun<240 and'q')
|
||||||
noKey=replaying
|
noKey=replaying
|
||||||
noTouch=replaying
|
noTouch=replaying
|
||||||
tasMode=false
|
|
||||||
floatGameRate,gameRate=0,1
|
floatGameRate,gameRate=0,1
|
||||||
_updateRepButtons()
|
_updateRepButtons()
|
||||||
end
|
end
|
||||||
@@ -133,7 +131,6 @@ function scene.sceneInit(org)
|
|||||||
GAME.init=false
|
GAME.init=false
|
||||||
end
|
end
|
||||||
|
|
||||||
tasMode=GAME.tasUsed
|
|
||||||
replaying=GAME.replaying
|
replaying=GAME.replaying
|
||||||
noKey=replaying
|
noKey=replaying
|
||||||
noTouch=not SETTING.VKSwitch or replaying
|
noTouch=not SETTING.VKSwitch or replaying
|
||||||
@@ -141,7 +138,7 @@ function scene.sceneInit(org)
|
|||||||
if org~='depause'and org~='pause'then
|
if org~='depause'and org~='pause'then
|
||||||
floatGameRate,gameRate=0,1
|
floatGameRate,gameRate=0,1
|
||||||
elseif not replaying then
|
elseif not replaying then
|
||||||
if tasMode then
|
if GAME.tasUsed then
|
||||||
floatGameRate,gameRate=0,0
|
floatGameRate,gameRate=0,0
|
||||||
else
|
else
|
||||||
floatGameRate,gameRate=0,1
|
floatGameRate,gameRate=0,1
|
||||||
@@ -216,7 +213,7 @@ function scene.keyDown(key,isRep)
|
|||||||
if isRep then
|
if isRep then
|
||||||
return
|
return
|
||||||
elseif _checkGameKeyDown(key)then
|
elseif _checkGameKeyDown(key)then
|
||||||
if tasMode then
|
if GAME.tasUsed then
|
||||||
if key=="f1"then
|
if key=="f1"then
|
||||||
if not isRep then gameRate=gameRate==0 and .125 or 0 end
|
if not isRep then gameRate=gameRate==0 and .125 or 0 end
|
||||||
_updateRepButtons()
|
_updateRepButtons()
|
||||||
@@ -328,13 +325,14 @@ local function _drawAtkPointer(x,y)
|
|||||||
gc.circle('line',x,y,30*(1+a),6)
|
gc.circle('line',x,y,30*(1+a),6)
|
||||||
end
|
end
|
||||||
function scene.draw()
|
function scene.draw()
|
||||||
if tasMode then
|
local tas=GAME.tasUsed
|
||||||
|
if tas then
|
||||||
setFont(100)
|
setFont(100)
|
||||||
gc.setColor(.4,.4,.4,.5)
|
gc.setColor(.4,.4,.4,.5)
|
||||||
mDraw(tasText,640,360,nil,5)
|
mDraw(tasText,640,360,nil,5)
|
||||||
end
|
end
|
||||||
|
|
||||||
local repMode=GAME.replaying or tasMode
|
local repMode=GAME.replaying or tas
|
||||||
|
|
||||||
--Players
|
--Players
|
||||||
for p=1,#PLAYERS do
|
for p=1,#PLAYERS do
|
||||||
@@ -370,7 +368,7 @@ function scene.draw()
|
|||||||
gc.draw(drawableText.modeName,modeTextPos,10)
|
gc.draw(drawableText.modeName,modeTextPos,10)
|
||||||
|
|
||||||
--Replaying
|
--Replaying
|
||||||
if replaying or tasMode then
|
if replaying or tas then
|
||||||
setFont(20)
|
setFont(20)
|
||||||
gc.setColor(1,1,TIME()%.8>.4 and 1 or 0)
|
gc.setColor(1,1,TIME()%.8>.4 and 1 or 0)
|
||||||
mStr(text[replaying and'replaying'or'tasUsing'],770,6)
|
mStr(text[replaying and'replaying'or'tasUsing'],770,6)
|
||||||
|
|||||||
Reference in New Issue
Block a user