修改部分小游戏的进入单词,小游戏jgt内部名改为ten,新增小游戏tap
This commit is contained in:
@@ -759,7 +759,7 @@ return{
|
|||||||
{"Minigame",
|
{"Minigame",
|
||||||
"minigame",
|
"minigame",
|
||||||
"other",
|
"other",
|
||||||
"Type the following codes in the search bar of this dictionary for some fun minigames!\n\n15-Puzzle: 15p\nSchulte Grid: sltg\nPong: pong\nAtoZ: atoz\nUltimate Tic-tac-toe: uttt\nCubefield: cbf\n2048: 2048\nJust get ten: jgt",
|
"Type the following codes in the search bar of this dictionary for some fun minigames!\n\n15-Puzzle: 15p\nSchulte Grid: grid\nPong: pong\nAtoZ: atoz\nUltimate Tic-tac-toe: uttt\nCubefield: cube\n2048: 2048\nJust get ten: ten\nTapping speed test: tap",
|
||||||
},
|
},
|
||||||
|
|
||||||
--English
|
--English
|
||||||
|
|||||||
@@ -770,7 +770,7 @@ return{
|
|||||||
{"小游戏",
|
{"小游戏",
|
||||||
"minigame xiaoyouxi",
|
"minigame xiaoyouxi",
|
||||||
"other",
|
"other",
|
||||||
"输入以下词语,小游戏免费玩!\n\n15-Puzzle: 15p\nSchulte Grid: sltg\nPong: pong\nAtoZ: atoz\nUltimate Tic-tac-toe: uttt\nCubefield: cbf\n2048: 2048\nJust get ten: jgt",
|
"输入以下词语,小游戏免费玩!\n\n15-Puzzle: 15p\nSchulte Grid: grid\nPong: pong\nAtoZ: atoz\nUltimate Tic-tac-toe: uttt\nCubefield: cube\n2048: 2048\nJust get ten: ten\nTapping speed test: tap",
|
||||||
},
|
},
|
||||||
|
|
||||||
--英文
|
--英文
|
||||||
|
|||||||
@@ -641,7 +641,7 @@ return{
|
|||||||
|
|
||||||
skip="Skip Round",
|
skip="Skip Round",
|
||||||
},
|
},
|
||||||
mg_jgt={
|
mg_ten={
|
||||||
reset="Reset",
|
reset="Reset",
|
||||||
next="Next",
|
next="Next",
|
||||||
blind="Blind",
|
blind="Blind",
|
||||||
|
|||||||
@@ -555,7 +555,7 @@ return{
|
|||||||
-- tapControl="Tap control",
|
-- tapControl="Tap control",
|
||||||
-- skip="Skip Round",
|
-- skip="Skip Round",
|
||||||
},
|
},
|
||||||
mg_jgt={
|
mg_ten={
|
||||||
reset="Réinitialiser",
|
reset="Réinitialiser",
|
||||||
next="Prévisualisations",
|
next="Prévisualisations",
|
||||||
blind="Aveugler",
|
blind="Aveugler",
|
||||||
|
|||||||
@@ -640,7 +640,7 @@ return{
|
|||||||
-- tapControl="Tap control",
|
-- tapControl="Tap control",
|
||||||
-- skip="Skip Round",
|
-- skip="Skip Round",
|
||||||
},
|
},
|
||||||
mg_jgt={
|
mg_ten={
|
||||||
reset="Resetar",
|
reset="Resetar",
|
||||||
next="Próxima",
|
next="Próxima",
|
||||||
blind="Cego",
|
blind="Cego",
|
||||||
|
|||||||
@@ -557,7 +557,7 @@ return{
|
|||||||
-- tapControl="Tap control",
|
-- tapControl="Tap control",
|
||||||
-- skip="Skip Round",
|
-- skip="Skip Round",
|
||||||
},
|
},
|
||||||
mg_jgt={
|
mg_ten={
|
||||||
reset="Reiniciar",
|
reset="Reiniciar",
|
||||||
next="Siguiente",
|
next="Siguiente",
|
||||||
blind="A ciegas",
|
blind="A ciegas",
|
||||||
|
|||||||
@@ -484,7 +484,7 @@ return{
|
|||||||
tapControl="_↓",
|
tapControl="_↓",
|
||||||
skip=">>",
|
skip=">>",
|
||||||
},
|
},
|
||||||
mg_jgt={
|
mg_ten={
|
||||||
reset="R",
|
reset="R",
|
||||||
next="→",
|
next="→",
|
||||||
blind="???",
|
blind="???",
|
||||||
|
|||||||
@@ -643,7 +643,7 @@ return{
|
|||||||
|
|
||||||
skip="跳过回合",
|
skip="跳过回合",
|
||||||
},
|
},
|
||||||
mg_jgt={
|
mg_ten={
|
||||||
reset="重置",
|
reset="重置",
|
||||||
next="预览",
|
next="预览",
|
||||||
blind="盲打",
|
blind="盲打",
|
||||||
|
|||||||
@@ -39,13 +39,14 @@ local function clearResult()
|
|||||||
end
|
end
|
||||||
local eggInput={
|
local eggInput={
|
||||||
["15p"]=goScene"mg_15p",
|
["15p"]=goScene"mg_15p",
|
||||||
sltg=goScene"mg_schulteG",
|
grid=goScene"mg_schulteG",
|
||||||
pong=goScene"mg_pong",
|
pong=goScene"mg_pong",
|
||||||
atoz=goScene"mg_AtoZ",
|
atoz=goScene"mg_AtoZ",
|
||||||
uttt=goScene"mg_UTTT",
|
uttt=goScene"mg_UTTT",
|
||||||
cbf=goScene"mg_cubefield",
|
cube=goScene"mg_cubefield",
|
||||||
["2048"]=goScene"mg_2048",
|
["2048"]=goScene"mg_2048",
|
||||||
jgt=goScene"mg_jgt",
|
ten=goScene"mg_ten",
|
||||||
|
tap=goScene"mg_tap",
|
||||||
flag=function()
|
flag=function()
|
||||||
BG.setDefault("none")
|
BG.setDefault("none")
|
||||||
BGM.setDefault(false)
|
BGM.setDefault(false)
|
||||||
|
|||||||
83
parts/scenes/mg_tap.lua
Normal file
83
parts/scenes/mg_tap.lua
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
local gc=love.graphics
|
||||||
|
local int,max=math.floor,math.max
|
||||||
|
local format=string.format
|
||||||
|
local ins=table.insert
|
||||||
|
local mStr=mStr
|
||||||
|
|
||||||
|
local scene={}
|
||||||
|
|
||||||
|
local lastKey
|
||||||
|
local keyTime
|
||||||
|
local speed=0
|
||||||
|
local maxSpeed=260
|
||||||
|
|
||||||
|
function scene.sceneInit()
|
||||||
|
BG.set("grey")
|
||||||
|
BGM.play("push")
|
||||||
|
love.keyboard.setKeyRepeat(false)
|
||||||
|
|
||||||
|
lastKey=nil
|
||||||
|
speed=0
|
||||||
|
keyTime={}for i=1,40 do keyTime[i]=-1e99 end
|
||||||
|
end
|
||||||
|
function scene.sceneBack()
|
||||||
|
love.keyboard.setKeyRepeat(true)
|
||||||
|
end
|
||||||
|
|
||||||
|
function scene.keyDown(key)
|
||||||
|
if key=="escape"then
|
||||||
|
SCN.back()
|
||||||
|
else
|
||||||
|
if lastKey~=key then
|
||||||
|
lastKey=key
|
||||||
|
else
|
||||||
|
ins(keyTime,1,TIME())
|
||||||
|
keyTime[41]=nil
|
||||||
|
SFX.play("click",.3)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function scene.update()
|
||||||
|
local time=TIME()
|
||||||
|
local v=0
|
||||||
|
for i=2,40 do v=v+i*(i-1)*.075/(time-keyTime[i])end
|
||||||
|
speed=speed*.99+v*.01
|
||||||
|
if speed>maxSpeed then maxSpeed=speed end
|
||||||
|
end
|
||||||
|
|
||||||
|
function scene.draw()
|
||||||
|
setFont(70)gc.setColor(1,.6,.6)
|
||||||
|
mStr(format("%.2f",maxSpeed),640,20)
|
||||||
|
|
||||||
|
setFont(35)gc.setColor(.7,.7,1)
|
||||||
|
mStr(format("%.2f",maxSpeed/60),640,95)
|
||||||
|
|
||||||
|
setFont(100)gc.setColor(1,1,1)
|
||||||
|
mStr(format("%.2f",speed),640,150)
|
||||||
|
|
||||||
|
setFont(35)gc.setColor(1,1,1)
|
||||||
|
mStr(format("%.2f",speed/60),640,255)
|
||||||
|
|
||||||
|
setFont(60)gc.setColor(.7,.7,.7)
|
||||||
|
mStr("/min",640,310)
|
||||||
|
|
||||||
|
|
||||||
|
gc.setLineWidth(4)
|
||||||
|
if speed==maxSpeed then
|
||||||
|
local t=TIME()%.1>.05 and 1 or 0
|
||||||
|
gc.setColor(1,t,t)
|
||||||
|
else
|
||||||
|
gc.setColor(max(speed/maxSpeed*10-9,0),1-max(speed/maxSpeed*8-7,0),1-max(speed/maxSpeed*4-3,0))
|
||||||
|
end
|
||||||
|
gc.rectangle("fill",960,360,30,-320*max(speed/maxSpeed*4-3,0))
|
||||||
|
gc.setColor(1,1,1)
|
||||||
|
gc.rectangle("line",960,360,30,-320)
|
||||||
|
end
|
||||||
|
|
||||||
|
scene.widgetList={
|
||||||
|
WIDGET.newKey{name="tap", x=640,y=540,w=626,h=260,fText="TAP",color="white",font=100,code=pressKey"button"},
|
||||||
|
WIDGET.newButton{name="back", x=1140,y=640,w=170,h=80,font=40,code=backScene},
|
||||||
|
}
|
||||||
|
|
||||||
|
return scene
|
||||||
Reference in New Issue
Block a user