小程序arm添加计时器和重置按钮,删除测试用的跳过按钮
This commit is contained in:
@@ -611,6 +611,9 @@ return{
|
|||||||
reset="Reiniciar",
|
reset="Reiniciar",
|
||||||
invis="A ciegas",
|
invis="A ciegas",
|
||||||
},
|
},
|
||||||
|
app_arithmetic={
|
||||||
|
reset="Reiniciar",
|
||||||
|
},
|
||||||
savedata={
|
savedata={
|
||||||
export="Exportar al portapapeles",
|
export="Exportar al portapapeles",
|
||||||
import="Importar de portapapeles",
|
import="Importar de portapapeles",
|
||||||
|
|||||||
@@ -612,6 +612,9 @@ return{
|
|||||||
reset="Réinitialiser",
|
reset="Réinitialiser",
|
||||||
invis="Aveugler",
|
invis="Aveugler",
|
||||||
},
|
},
|
||||||
|
app_arithmetic={
|
||||||
|
reset="Réinitialiser",
|
||||||
|
},
|
||||||
savedata={
|
savedata={
|
||||||
-- export="Export to clipboard",
|
-- export="Export to clipboard",
|
||||||
-- import="Import from clipboard",
|
-- import="Import from clipboard",
|
||||||
|
|||||||
@@ -642,6 +642,9 @@ return{
|
|||||||
reset="Resetar",
|
reset="Resetar",
|
||||||
invis="Cego",
|
invis="Cego",
|
||||||
},
|
},
|
||||||
|
app_arithmetic={
|
||||||
|
reset="Resetar",
|
||||||
|
},
|
||||||
savedata={
|
savedata={
|
||||||
-- export="Export to clipboard",
|
-- export="Export to clipboard",
|
||||||
-- import="Import from clipboard",
|
-- import="Import from clipboard",
|
||||||
|
|||||||
@@ -656,6 +656,9 @@ return{
|
|||||||
reset="重置",
|
reset="重置",
|
||||||
invis="盲打",
|
invis="盲打",
|
||||||
},
|
},
|
||||||
|
app_arithmetic={
|
||||||
|
reset="重置",
|
||||||
|
},
|
||||||
savedata={
|
savedata={
|
||||||
export="导出到剪切板",
|
export="导出到剪切板",
|
||||||
import="从剪切板导入",
|
import="从剪切板导入",
|
||||||
|
|||||||
@@ -413,7 +413,6 @@ return{
|
|||||||
ihs="初始持有",
|
ihs="初始持有",
|
||||||
irs="初始旋转",
|
irs="初始旋转",
|
||||||
ims="初始运动",
|
ims="初始运动",
|
||||||
reset="重置",
|
|
||||||
},
|
},
|
||||||
setting_key={
|
setting_key={
|
||||||
a1="向左移动",
|
a1="向左移动",
|
||||||
@@ -614,7 +613,6 @@ return{
|
|||||||
revKB="逆转",
|
revKB="逆转",
|
||||||
},
|
},
|
||||||
app_schulteG={
|
app_schulteG={
|
||||||
reset="重置",
|
|
||||||
rank="大小",
|
rank="大小",
|
||||||
invis="英维斯",
|
invis="英维斯",
|
||||||
disappear="隐藏",
|
disappear="隐藏",
|
||||||
@@ -626,30 +624,25 @@ return{
|
|||||||
app_AtoZ={
|
app_AtoZ={
|
||||||
level="水平仪",
|
level="水平仪",
|
||||||
keyboard="键盘",
|
keyboard="键盘",
|
||||||
reset="重置",
|
|
||||||
},
|
},
|
||||||
app_2048={
|
app_2048={
|
||||||
reset="重置",
|
|
||||||
invis="英维斯",
|
invis="英维斯",
|
||||||
tapControl="抽头控制",
|
tapControl="抽头控制",
|
||||||
|
|
||||||
skip="跳转",
|
skip="跳转",
|
||||||
},
|
},
|
||||||
app_ten={
|
app_ten={
|
||||||
reset="重置",
|
|
||||||
next="下一个",
|
next="下一个",
|
||||||
invis="英维斯",
|
invis="英维斯",
|
||||||
fast="快速的",
|
fast="快速的",
|
||||||
},
|
},
|
||||||
app_dtw={
|
app_dtw={
|
||||||
reset="重置",
|
|
||||||
color="颜色",
|
color="颜色",
|
||||||
mode="模式",
|
mode="模式",
|
||||||
bgm="血糖监测",
|
bgm="血糖监测",
|
||||||
arcade="游乐中心",
|
arcade="游乐中心",
|
||||||
},
|
},
|
||||||
app_link={
|
app_link={
|
||||||
reset="重置",
|
|
||||||
invis="英维斯",
|
invis="英维斯",
|
||||||
},
|
},
|
||||||
savedata={
|
savedata={
|
||||||
|
|||||||
@@ -655,6 +655,9 @@ return{
|
|||||||
reset="重設",
|
reset="重設",
|
||||||
invis="盲打",
|
invis="盲打",
|
||||||
},
|
},
|
||||||
|
app_arithmetic={
|
||||||
|
reset="重設",
|
||||||
|
},
|
||||||
savedata={
|
savedata={
|
||||||
export="導出到剪貼板",
|
export="導出到剪貼板",
|
||||||
import="從剪貼板導入",
|
import="從剪貼板導入",
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ local rnd=math.random
|
|||||||
local int,ceil=math.floor,math.ceil
|
local int,ceil=math.floor,math.ceil
|
||||||
local char=string.char
|
local char=string.char
|
||||||
|
|
||||||
|
local timing,time
|
||||||
|
|
||||||
local function b2(i)
|
local function b2(i)
|
||||||
if i==0 then return 0 end
|
if i==0 then return 0 end
|
||||||
local s=""
|
local s=""
|
||||||
@@ -114,17 +116,27 @@ local levels={
|
|||||||
local a=rnd(17,int(s/2))
|
local a=rnd(17,int(s/2))
|
||||||
return{COLOR.J,b16(a),COLOR.Z,"+",COLOR.J,b16(s-a)},s
|
return{COLOR.J,b16(a),COLOR.Z,"+",COLOR.J,b16(s-a)},s
|
||||||
end,nil,nil,
|
end,nil,nil,
|
||||||
function()return "Coming S∞n"..(rnd()<.5 and""or" "),1e99 end,
|
function()timing=false return "Coming S∞n"..(rnd()<.5 and""or" "),1e99 end,
|
||||||
}setmetatable(levels,{__index=function(self,k)return self[k-1]end})
|
}setmetatable(levels,{__index=function(self,k)return self[k-1]end})
|
||||||
|
|
||||||
local level
|
local level
|
||||||
|
|
||||||
local input,inputTime=0,0
|
local input,inputTime=0,0
|
||||||
local question,answer
|
local question,answer
|
||||||
|
|
||||||
local function newQuestion(lv)
|
local function newQuestion(lv)
|
||||||
return levels[lv]()
|
return levels[lv]()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function reset()
|
||||||
|
timing=true
|
||||||
|
time=0
|
||||||
|
input=""
|
||||||
|
inputTime=0
|
||||||
|
level=1
|
||||||
|
question,answer=newQuestion(1)
|
||||||
|
end
|
||||||
|
|
||||||
local function check(val)
|
local function check(val)
|
||||||
if val==answer then
|
if val==answer then
|
||||||
level=level+1
|
level=level+1
|
||||||
@@ -142,10 +154,7 @@ end
|
|||||||
local scene={}
|
local scene={}
|
||||||
|
|
||||||
function scene.sceneInit()
|
function scene.sceneInit()
|
||||||
input=""
|
reset()
|
||||||
inputTime=0
|
|
||||||
level=1
|
|
||||||
question,answer=newQuestion(1)
|
|
||||||
BGM.play('truth')
|
BGM.play('truth')
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -173,14 +182,15 @@ function scene.keyDown(key,isRep)
|
|||||||
elseif key=="backspace"then
|
elseif key=="backspace"then
|
||||||
input=""
|
input=""
|
||||||
inputTime=0
|
inputTime=0
|
||||||
elseif key=="s"then
|
elseif key=="r"then
|
||||||
check(answer)
|
reset()
|
||||||
elseif key=="escape"then
|
elseif key=="escape"then
|
||||||
SCN.back()
|
SCN.back()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function scene.update(dt)
|
function scene.update(dt)
|
||||||
|
if timing then time=time+dt end
|
||||||
if inputTime>0 then
|
if inputTime>0 then
|
||||||
inputTime=inputTime-dt
|
inputTime=inputTime-dt
|
||||||
if inputTime<=0 then
|
if inputTime<=0 then
|
||||||
@@ -189,8 +199,11 @@ function scene.update(dt)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function scene.draw()
|
function scene.draw()
|
||||||
FONT.set(35)
|
|
||||||
gc.setColor(COLOR.Z)
|
gc.setColor(COLOR.Z)
|
||||||
|
FONT.set(45)
|
||||||
|
gc.print(("%.3f"):format(time),1026,70)
|
||||||
|
|
||||||
|
FONT.set(35)
|
||||||
GC.mStr("["..level.."]",640,30)
|
GC.mStr("["..level.."]",640,30)
|
||||||
|
|
||||||
FONT.set(100)
|
FONT.set(100)
|
||||||
@@ -203,6 +216,7 @@ function scene.draw()
|
|||||||
end
|
end
|
||||||
|
|
||||||
scene.widgetList={
|
scene.widgetList={
|
||||||
|
WIDGET.newButton{name='reset',x=155,y=100,w=180,h=100,color='lG',font=40,code=pressKey"r"},
|
||||||
WIDGET.newKey{name='X',x=540,y=620,w=90,font=60,fText="X",code=pressKey"backspace"},
|
WIDGET.newKey{name='X',x=540,y=620,w=90,font=60,fText="X",code=pressKey"backspace"},
|
||||||
WIDGET.newKey{name='0',x=640,y=620,w=90,font=60,fText="0",code=pressKey"0"},
|
WIDGET.newKey{name='0',x=640,y=620,w=90,font=60,fText="0",code=pressKey"0"},
|
||||||
WIDGET.newKey{name='-',x=740,y=620,w=90,font=60,fText="-",code=pressKey"-"},
|
WIDGET.newKey{name='-',x=740,y=620,w=90,font=60,fText="-",code=pressKey"-"},
|
||||||
|
|||||||
Reference in New Issue
Block a user