代码规范:把所有的tab换成空格
This commit is contained in:
@@ -86,7 +86,7 @@ function TEXT.show(text,x,y,font,style,spd,stop)
|
||||
font=int(font/5)*5 or 40,--Font
|
||||
spd=(spd or 1)/60, --Timing speed(1=last 1 sec)
|
||||
stop=stop, --Stop time(sustained text)
|
||||
draw=textFX[style or'appear']or error("unavailable type:"..style), --Draw method
|
||||
draw=assert(textFX[style or'appear'],"no text type:"..style),--Draw method
|
||||
})
|
||||
end
|
||||
function TEXT.getText(text,x,y,font,style,spd,stop)--Another version of TEXT.show(), but only return text object, need manual management
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
hideBoard false 场地隐藏模式("down"|"up"|"all")
|
||||
flipBoard false 场地翻转模式("U-D"|"L-R"|"180")
|
||||
|
||||
sequence 'bag' 序列模式,是放一块后对next序列的刷新函数,可以使用默认的几个函数用字符串表示。也可以自己写一个,注意:使用协程技术
|
||||
sequence bag' 序列模式,是放一块后对next序列的刷新函数,可以使用默认的几个函数用字符串表示。也可以自己写一个,注意:使用协程技术
|
||||
seqData {1,2,3,4,5,6,7}序列模式使用的"包"数据(本质是生成序列用的数据,会作为参数传进上面那个叫sequence的序列生成函数,不一定是包)
|
||||
mission false 包含任务的table,说明暂时略
|
||||
|
||||
@@ -128,7 +128,7 @@ return{--返回一个table,你也可以在之前定义一些常量或者函数
|
||||
color=COLOR.green,--颜色
|
||||
env={--模式环境变量
|
||||
drop=60,lock=60,
|
||||
dropPiece=function(P)if P.stat.row>=40 then P win('finish')end end,
|
||||
dropPiece=function(P)if P.stat.row>=40 then P:win('finish')end end,
|
||||
bg='bg2',bgm='race',
|
||||
},
|
||||
load=function()--模式加载函数,这里只生成了一个玩家,常用的单人模式可以不写,默认使用这个函数
|
||||
|
||||
@@ -142,7 +142,7 @@ end
|
||||
scene.widgetList={
|
||||
roomList,
|
||||
passwordBox,
|
||||
WIDGET.newKey{name="setting",fText=TEXTURE.setting,x=1200,y=160,w=90,h=90,code=pressKey"s"},
|
||||
WIDGET.newKey{name="setting", x=1200,y=160,w=90,h=90,fText=TEXTURE.setting,code=pressKey"s"},
|
||||
WIDGET.newText{name="refreshing",x=450,y=240,font=45,hideF=function()return not NET.getlock('fetchRoom')end},
|
||||
WIDGET.newText{name="noRoom", x=450,y=245,font=40,hideF=function()return roomList:getLen()>0 or NET.getlock('fetchRoom')end},
|
||||
WIDGET.newKey{name="refresh", x=250,y=630,w=140,h=120,code=_fetchRoom,hideF=function()return fetchTimer>7 end},
|
||||
|
||||
@@ -31,52 +31,52 @@ local holdImages={
|
||||
|
||||
local virtualkeySet={
|
||||
{
|
||||
{id=1, x=80, y=720-200, r=80},--moveLeft
|
||||
{id=2, x=320, y=720-200, r=80},--moveRight
|
||||
{id=3, x=1280-80, y=720-200, r=80},--rotRight
|
||||
{id=4, x=1280-200, y=720-80, r=80},--rotLeft
|
||||
{id=5, x=1280-200, y=720-320, r=80},--rot180
|
||||
{id=6, x=200, y=720-320, r=80},--hardDrop
|
||||
{id=7, x=200, y=720-80, r=80},--softDrop
|
||||
{id=8, x=1280-320, y=720-200, r=80},--hold
|
||||
{id=1, x=80, y=-200, r=80},--moveLeft
|
||||
{id=2, x=320, y=-200, r=80},--moveRight
|
||||
{id=3, x=-80, y=-200, r=80},--rotRight
|
||||
{id=4, x=-200, y=-80, r=80},--rotLeft
|
||||
{id=5, x=-200, y=-320, r=80},--rot180
|
||||
{id=6, x=200, y=-320, r=80},--hardDrop
|
||||
{id=7, x=200, y=-80, r=80},--softDrop
|
||||
{id=8, x=-320, y=-200, r=80},--hold
|
||||
{id=9, x=80, y=280, r=80},--func1
|
||||
{id=10, x=1280-80, y=280, r=80},--func2
|
||||
{id=10, x=-80, y=280, r=80},--func2
|
||||
},--Farter's tetr.js set
|
||||
{
|
||||
{id=1, x=1280-320, y=720-200, r=80},--moveLeft
|
||||
{id=2, x=1280-80, y=720-200, r=80},--moveRight
|
||||
{id=3, x=200, y=720-80, r=80},--rotRight
|
||||
{id=4, x=80, y=720-200, r=80},--rotLeft
|
||||
{id=5, x=200, y=720-320, r=80},--rot180
|
||||
{id=6, x=1280-200, y=720-320, r=80},--hardDrop
|
||||
{id=7, x=1280-200, y=720-80, r=80},--softDrop
|
||||
{id=8, x=320, y=720-200, r=80},--hold
|
||||
{id=9, x=1280-80, y=280, r=80},--func1
|
||||
{id=1, x=-320, y=-200, r=80},--moveLeft
|
||||
{id=2, x=-80, y=-200, r=80},--moveRight
|
||||
{id=3, x=200, y=-80, r=80},--rotRight
|
||||
{id=4, x=80, y=-200, r=80},--rotLeft
|
||||
{id=5, x=200, y=-320, r=80},--rot180
|
||||
{id=6, x=-200, y=-320, r=80},--hardDrop
|
||||
{id=7, x=-200, y=-80, r=80},--softDrop
|
||||
{id=8, x=320, y=-200, r=80},--hold
|
||||
{id=9, x=-80, y=280, r=80},--func1
|
||||
{id=10, x=80, y=280, r=80},--func2
|
||||
},--Mirrored tetr.js set
|
||||
{
|
||||
{id=1, x=80, y=720-80, r=80},--moveLeft
|
||||
{id=2, x=240, y=720-80, r=80},--moveRight
|
||||
{id=3, x=1280-240, y=720-80, r=80},--rotRight
|
||||
{id=4, x=1280-400, y=720-80, r=80},--rotLeft
|
||||
{id=5, x=1280-240, y=720-240, r=80},--rot180
|
||||
{id=6, x=1280-80, y=720-80, r=80},--hardDrop
|
||||
{id=7, x=1280-80, y=720-240, r=80},--softDrop
|
||||
{id=8, x=1280-80, y=720-400, r=80},--hold
|
||||
{id=9, x=80, y=720-240, r=80},--func1
|
||||
{id=10, x=240, y=720-240, r=80},--func2
|
||||
{id=1, x=80, y=-80, r=80},--moveLeft
|
||||
{id=2, x=240, y=-80, r=80},--moveRight
|
||||
{id=3, x=-240, y=-80, r=80},--rotRight
|
||||
{id=4, x=-400, y=-80, r=80},--rotLeft
|
||||
{id=5, x=-240, y=-240, r=80},--rot180
|
||||
{id=6, x=-80, y=-80, r=80},--hardDrop
|
||||
{id=7, x=-80, y=-240, r=80},--softDrop
|
||||
{id=8, x=-80, y=-400, r=80},--hold
|
||||
{id=9, x=80, y=-240, r=80},--func1
|
||||
{id=10, x=240, y=-240, r=80},--func2
|
||||
},--Author's set, not recommend
|
||||
{
|
||||
{id=1, x=1280-400, y=720-80, r=80},--moveLeft
|
||||
{id=2, x=1280-80, y=720-80, r=80},--moveRight
|
||||
{id=3, x=240, y=720-80, r=80},--rotRight
|
||||
{id=4, x=80, y=720-80, r=80},--rotLeft
|
||||
{id=5, x=240, y=720-240, r=80},--rot180
|
||||
{id=6, x=1280-240, y=720-240, r=80},--hardDrop
|
||||
{id=7, x=1280-240, y=720-80, r=80},--softDrop
|
||||
{id=8, x=400, y=720-80, r=80},--hold
|
||||
{id=9, x=80, y=720-240, r=80},--func1
|
||||
{id=10, x=80, y=720-400, r=80},--func2
|
||||
{id=1, x=-400, y=-80, r=80},--moveLeft
|
||||
{id=2, x=-80, y=-80, r=80},--moveRight
|
||||
{id=3, x=240, y=-80, r=80},--rotRight
|
||||
{id=4, x=80, y=-80, r=80},--rotLeft
|
||||
{id=5, x=240, y=-240, r=80},--rot180
|
||||
{id=6, x=-240, y=-240, r=80},--hardDrop
|
||||
{id=7, x=-240, y=-80, r=80},--softDrop
|
||||
{id=8, x=400, y=-80, r=80},--hold
|
||||
{id=9, x=80, y=-240, r=80},--func1
|
||||
{id=10, x=80, y=-400, r=80},--func2
|
||||
},--Keyboard set
|
||||
{
|
||||
{id=9, x=70, y=50, r=30},--func1
|
||||
@@ -101,7 +101,12 @@ local virtualkeySet={
|
||||
{id=20, x=1210, y=50, r=30},--zangiRight
|
||||
},--PC key feedback(top&in a row)
|
||||
}
|
||||
|
||||
for _,set in next,virtualkeySet do
|
||||
for _,key in next,set do
|
||||
if key.x<0 then key.x=1280+key.x end
|
||||
if key.y<0 then key.x=720+key.y end
|
||||
end
|
||||
end
|
||||
--Virtualkey icons
|
||||
local VKIcon={}
|
||||
gc.setDefaultFilter('nearest','nearest')
|
||||
|
||||
Reference in New Issue
Block a user