整理代码
This commit is contained in:
@@ -8,6 +8,10 @@ function MATH.sign(a)
|
|||||||
return a>0 and 1 or a<0 and -1 or 0
|
return a>0 and 1 or a<0 and -1 or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function MATH.roll(chance)
|
||||||
|
return rnd()<(chance or .5)
|
||||||
|
end
|
||||||
|
|
||||||
function MATH.coin(a,b)
|
function MATH.coin(a,b)
|
||||||
if rnd()<.5 then
|
if rnd()<.5 then
|
||||||
return a
|
return a
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ local function newTile()
|
|||||||
if nextCD>0 then
|
if nextCD>0 then
|
||||||
nextTile=1
|
nextTile=1
|
||||||
else
|
else
|
||||||
nextTile=rnd()>.1 and 2 or rnd()>.1 and 3 or 4
|
nextTile=MATH.roll(.9)and 2 or MATH.roll(.9)and 3 or 4
|
||||||
nextCD=rnd(8,12)
|
nextCD=rnd(8,12)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ end
|
|||||||
|
|
||||||
local function start()
|
local function start()
|
||||||
state=1
|
state=1
|
||||||
vx=rnd()>.5 and 6 or -6
|
vx=MATH.coin(6,-6)
|
||||||
vy=rnd()*6-3
|
vy=rnd()*6-3
|
||||||
end
|
end
|
||||||
function scene.keyDown(key,isRep)
|
function scene.keyDown(key,isRep)
|
||||||
|
|||||||
@@ -29,10 +29,10 @@ local typeColor={
|
|||||||
english=COLOR.B,
|
english=COLOR.B,
|
||||||
name=COLOR.lV,
|
name=COLOR.lV,
|
||||||
}
|
}
|
||||||
local function _filter(word)
|
local function _filter(word_org)
|
||||||
local word_org=word
|
local word=word_org
|
||||||
if FNSF then word=word:gsub("[Pp]atreon",CHAR.zChan.spark)end
|
|
||||||
word=word:gsub("[Tt]etris",CHAR.zChan.thinking)
|
word=word:gsub("[Tt]etris",CHAR.zChan.thinking)
|
||||||
|
if FNSF then word=word:gsub("[Pp]atreon",CHAR.zChan.qualified)end
|
||||||
return word,word_org
|
return word,word_org
|
||||||
end
|
end
|
||||||
local function _scanDict(D)
|
local function _scanDict(D)
|
||||||
|
|||||||
Reference in New Issue
Block a user