整 理 代 码

(应该没有改到字符串里面的东西吧…)起码不直接影响运行
This commit is contained in:
MrZ_26
2022-10-01 11:32:11 +08:00
parent 6e00ff96ec
commit 06f4bb4e1a
236 changed files with 2087 additions and 2114 deletions

View File

@@ -44,28 +44,28 @@ local function start()
end
function scene.keyDown(key,isRep)
if isRep then return end
if key=='space'then
if key=='space' then
if state==0 then
start()
end
elseif key=='r'then
elseif key=='r' then
state=0
bx,by=640,360
vx,vy=0,0
ry=0
p1.score,p2.score=0,0
SFX.play('hold')
elseif key=='w'or key=='s'then
elseif key=='w' or key=='s' then
p1.y0=false
elseif key=='up'or key=='down'then
elseif key=='up' or key=='down' then
p2.y0=false
elseif key=='escape'then
elseif key=='escape' then
SCN.back()
end
end
function scene.touchDown(x,y)
scene.touchMove(x,y)
if state==0 then start()end
if state==0 then start() end
end
function scene.touchMove(x,y)(x<640 and p1 or p2).y0=y end
function scene.mouseMove(x,y)(x<640 and p1 or p2).y0=y end
@@ -86,10 +86,10 @@ function scene.update()
P.vy=P.vy*.5
end
else
if kb.isDown(P==p1 and'w'or'up')then
if kb.isDown(P==p1 and 'w' or 'up') then
P.vy=max(P.vy-1,-8)
end
if kb.isDown(P==p1 and's'or'down')then
if kb.isDown(P==p1 and 's' or 'down') then
P.vy=min(P.vy+1,8)
end
P.y=P.y+P.vy