整理代码,修复新的彩蛋模式触屏进不去

This commit is contained in:
MrZ626
2021-09-27 00:31:56 +08:00
parent 702abbf7b1
commit f2ffdc9e58
8 changed files with 14 additions and 29 deletions

View File

@@ -252,9 +252,8 @@ function scene.mouseDown(x,y,k)
end
end
end
function scene.touchDown(x,y)
scene.mouseDown(x,y)
end
scene.touchDown=scene.mouseDown
local moveFunc={
up=moveUp,
down=moveDown,

View File

@@ -201,18 +201,9 @@ function scene.draw()
end
end
end
function scene.touchDown(x,y)
scene.mouseMove(x,y)
end
function scene.touchMove(x,y)
scene.mouseMove(x,y)
end
function scene.touchUp(x,y)
scene.mouseDown(x,y)
end
scene.touchDown=scene.mouseMove
scene.touchMove=scene.mouseMove
scene.touchUp=scene.mouseDown
function scene.mouseMove(x,y)
x,y=int((x-280)/80),int(y/80)

View File

@@ -149,8 +149,8 @@ function scene.mouseUp(_,_,k)
end
function scene.touchDown(x,y)scene.mouseDown(x,y,1)end
function scene.touchMove(x,y)scene.mouseMove(x,y)end
function scene.touchUp(x,y)scene.mouseUp(x,y,1)end
scene.touchMove=scene.mouseMove
function scene.keyDown(key)
if key=="up"or key=="down"or key=="left"or key=="right"then

View File

@@ -63,13 +63,13 @@ function scene.mouseDown(x,y,k)
end
end
end
function scene.touchMove(x,y)
scene.mouseMove(x,y)
end
scene.touchMove=scene.mouseMove
function scene.touchDown(x,y)
scene.mouseMove(x,y)
scene.mouseDown(x,y)
end
function scene.keyDown(key)
if key=="tab"or key=="delete"then
if GAME.mod[1]then

View File

@@ -35,9 +35,7 @@ function scene.mouseDown(x,y)
end
end
end
function scene.touchDown(x,y)
scene.mouseDown(x,y)
end
scene.touchDown=scene.mouseDown
function scene.update()
if jump>0 then

View File

@@ -111,15 +111,14 @@ local function press(x,y)
end
end
function scene.mouseDown(x,y)
scene.touchDown(x,y)
end
function scene.touchDown(x,y)
x,y=int((x-pad.x)/80),int((y-pad.y)/80)
if x>=0 and x<=8 and y>=0 and y<=7 then
press(x,y+1)
end
end
scene.mouseDown=scene.touchDown
function scene.keyDown(key,isRep)
if isRep then return end
if #key==1 then

View File

@@ -30,10 +30,7 @@ function scene.mouseDown(x,y)
end
end
end
function scene.touchDown(x,y)
scene.mouseDown(x,y)
end
scene.touchDown=scene.mouseDown
function scene.keyDown(key,isRep)
if isRep then return end

View File

@@ -52,6 +52,7 @@ function scene.mouseDown(x,y)
loadGame('sprintMD',true)
end
end
scene.touchDown=scene.mouseDown
function scene.draw()
local minoColor,skinSet=minoColor,SETTING.skin