整理代码
This commit is contained in:
@@ -73,7 +73,7 @@ function FILE.clear(path)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function FILE.clear_s(path)
|
function FILE.clear_s(path)
|
||||||
if path==''or (fs.getRealDirectory(path)==SAVEDIR and fs.getInfo(path).type=='directory')then
|
if path==''or(fs.getRealDirectory(path)==SAVEDIR and fs.getInfo(path).type=='directory')then
|
||||||
for _,name in next,fs.getDirectoryItems(path)do
|
for _,name in next,fs.getDirectoryItems(path)do
|
||||||
name=path..'/'..name
|
name=path..'/'..name
|
||||||
if fs.getRealDirectory(name)==SAVEDIR then
|
if fs.getRealDirectory(name)==SAVEDIR then
|
||||||
|
|||||||
@@ -47,13 +47,13 @@ function textFX.drive(t)
|
|||||||
nil,
|
nil,
|
||||||
nil,nil,
|
nil,nil,
|
||||||
t.text:getWidth()*.5,t.text:getHeight()*.5,
|
t.text:getWidth()*.5,t.text:getHeight()*.5,
|
||||||
t.c<.3 and (.3-t.c)*2 or 0,0
|
t.c<.3 and(.3-t.c)*2 or 0,0
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
function textFX.spin(t)
|
function textFX.spin(t)
|
||||||
draw(
|
draw(
|
||||||
t.text,t.x,t.y,
|
t.text,t.x,t.y,
|
||||||
t.c<.3 and (.3-t.c)^2*4 or t.c<.8 and 0 or (t.c-.8)^2*-4,
|
t.c<.3 and(.3-t.c)^2*4 or t.c<.8 and 0 or(t.c-.8)^2*-4,
|
||||||
nil,nil,
|
nil,nil,
|
||||||
t.text:getWidth()*.5,t.text:getHeight()*.5
|
t.text:getWidth()*.5,t.text:getHeight()*.5
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ local dialFrame=TEXTURE.dial.frame
|
|||||||
local dialNeedle=TEXTURE.dial.needle
|
local dialNeedle=TEXTURE.dial.needle
|
||||||
local multiple=TEXTURE.multiple
|
local multiple=TEXTURE.multiple
|
||||||
local playerborder=TEXTURE.playerBorder
|
local playerborder=TEXTURE.playerBorder
|
||||||
gridLines=TEXTURE.gridLines
|
local gridLines=TEXTURE.gridLines
|
||||||
|
|
||||||
local LDmarks=gc.newSpriteBatch(GC.DO{14,5,{'fRect',0,0,14,5,3}},15,'static')
|
local LDmarks=gc.newSpriteBatch(GC.DO{14,5,{'fRect',0,0,14,5,3}},15,'static')
|
||||||
for i=0,14 do LDmarks:add(3+20*i,615)end
|
for i=0,14 do LDmarks:add(3+20*i,615)end
|
||||||
|
|||||||
@@ -1818,7 +1818,6 @@ local function _updateFX(P,dt)
|
|||||||
end
|
end
|
||||||
local function update_alive(P)
|
local function update_alive(P)
|
||||||
local ENV=P.gameEnv
|
local ENV=P.gameEnv
|
||||||
local S=P.stat
|
|
||||||
|
|
||||||
P.frameRun=P.frameRun+1
|
P.frameRun=P.frameRun+1
|
||||||
if P.frameRun<=180 then
|
if P.frameRun<=180 then
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ function scene.keyDown(key,isRep)
|
|||||||
end
|
end
|
||||||
function scene.touchDown(x,y)
|
function scene.touchDown(x,y)
|
||||||
scene.keyDown(
|
scene.keyDown(
|
||||||
state==0 and "space"or
|
state==0 and"space"or
|
||||||
x<640 and
|
x<640 and
|
||||||
(y<360 and"q"or"a")or
|
(y<360 and"q"or"a")or
|
||||||
(y<360 and"p"or"l")
|
(y<360 and"p"or"l")
|
||||||
|
|||||||
@@ -62,10 +62,10 @@ local function _pTouch(x,y)
|
|||||||
end
|
end
|
||||||
if #penPath==0 then
|
if #penPath==0 then
|
||||||
penMode=
|
penMode=
|
||||||
pens[curPen]>0 and(FIELD[page][y][x]~=pens[curPen] and 0 or 1)or
|
pens[curPen]>0 and(FIELD[page][y][x]~=pens[curPen]and 0 or 1)or
|
||||||
pens[curPen]==0 and 1 or
|
pens[curPen]==0 and 1 or
|
||||||
pens[curPen]==-1 and 0 or
|
pens[curPen]==-1 and 0 or
|
||||||
pens[curPen]==-2 and (FIELD[page][y][x]<=0 and 0 or 1)
|
pens[curPen]==-2 and(FIELD[page][y][x]<=0 and 0 or 1)
|
||||||
end
|
end
|
||||||
ins(penPath,{x,y})
|
ins(penPath,{x,y})
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user