修改部分小游戏的进入单词,小游戏jgt内部名改为ten,新增小游戏tap

This commit is contained in:
MrZ626
2021-02-22 23:30:29 +08:00
parent 9083109ff1
commit 133d54597c
11 changed files with 95 additions and 11 deletions

View File

@@ -759,7 +759,7 @@ return{
{"Minigame",
"minigame",
"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

View File

@@ -770,7 +770,7 @@ return{
{"小游戏",
"minigame xiaoyouxi",
"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",
},
--英文

View File

@@ -641,7 +641,7 @@ return{
skip="Skip Round",
},
mg_jgt={
mg_ten={
reset="Reset",
next="Next",
blind="Blind",

View File

@@ -555,7 +555,7 @@ return{
-- tapControl="Tap control",
-- skip="Skip Round",
},
mg_jgt={
mg_ten={
reset="Réinitialiser",
next="Prévisualisations",
blind="Aveugler",

View File

@@ -640,7 +640,7 @@ return{
-- tapControl="Tap control",
-- skip="Skip Round",
},
mg_jgt={
mg_ten={
reset="Resetar",
next="Próxima",
blind="Cego",

View File

@@ -557,7 +557,7 @@ return{
-- tapControl="Tap control",
-- skip="Skip Round",
},
mg_jgt={
mg_ten={
reset="Reiniciar",
next="Siguiente",
blind="A ciegas",

View File

@@ -484,7 +484,7 @@ return{
tapControl="_↓",
skip=">>",
},
mg_jgt={
mg_ten={
reset="R",
next="",
blind="???",

View File

@@ -643,7 +643,7 @@ return{
skip="跳过回合",
},
mg_jgt={
mg_ten={
reset="重置",
next="预览",
blind="盲打",

View File

@@ -39,13 +39,14 @@ local function clearResult()
end
local eggInput={
["15p"]=goScene"mg_15p",
sltg=goScene"mg_schulteG",
grid=goScene"mg_schulteG",
pong=goScene"mg_pong",
atoz=goScene"mg_AtoZ",
uttt=goScene"mg_UTTT",
cbf=goScene"mg_cubefield",
cube=goScene"mg_cubefield",
["2048"]=goScene"mg_2048",
jgt=goScene"mg_jgt",
ten=goScene"mg_ten",
tap=goScene"mg_tap",
flag=function()
BG.setDefault("none")
BGM.setDefault(false)

83
parts/scenes/mg_tap.lua Normal file
View 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