Compare commits

..

17 Commits

Author SHA1 Message Date
MrZ_26
3bef016019 0.9.3:性能优化,细节修改 2020-07-27 00:14:57 +08:00
MrZ_26
4bff742b98 0.9.2:全局更新 2020-07-23 22:16:02 +08:00
MrZ_26
b97319afe0 0.9.2:方向键选择控件 2020-07-23 15:12:17 +08:00
MrZ_26
bb2c732529 0.9.2:调试界面,新背景,布局微调 2020-07-23 00:42:47 +08:00
MrZ_26
ae650bd1ff 0.9.2:调试界面,新背景,布局微调 2020-07-21 00:16:15 +08:00
MrZ_26
ee99943ed9 0.9.1:next音效 2020-07-20 00:06:31 +08:00
MrZ_26
60cbc83313 新tips,修复手机旋屏bug,各种调平,统计数据简化 2020-07-19 21:33:03 +08:00
MrZ_26
74bc1a2544 bug修复,水印修改,20G上级调平 2020-07-18 01:05:10 +08:00
MrZ_26
7b35d69be1 允许用键盘编辑序列 2020-07-17 17:37:48 +08:00
MrZ_26
f29fc7081a 0.9.0:自定义序列 2020-07-17 02:08:26 +08:00
MrZ_26
882b841d3f 界面美化/死亡动画/自定义序列编辑器 2020-07-15 23:22:44 +08:00
MrZ_26
3d22f5d8ca 强化水印&系统优化 2020-07-09 19:39:06 +08:00
MrZ_26
a3302ab2bc Zframework finished 2020-07-08 20:26:28 +08:00
MrZ_26
cdd5194108 [change file directory] 2020-07-05 14:56:58 +08:00
MrZ_26
40de030cae [Z-framework stand alone ready] 2020-07-05 14:46:02 +08:00
MrZ_26
e1d92a166b 0.8.24: Bug Fixed 2020-06-14 15:21:20 +08:00
MrZ_26
99b55b72e0 0.8.23: Details Update 2020-06-07 01:06:31 +08:00
125 changed files with 3330 additions and 2285 deletions

BIN
BGM/how feeling.ogg Normal file

Binary file not shown.

BIN
SFX/spawn_1.ogg Normal file

Binary file not shown.

BIN
SFX/spawn_2.ogg Normal file

Binary file not shown.

BIN
SFX/spawn_3.ogg Normal file

Binary file not shown.

BIN
SFX/spawn_4.ogg Normal file

Binary file not shown.

BIN
SFX/spawn_5.ogg Normal file

Binary file not shown.

BIN
SFX/spawn_6.ogg Normal file

Binary file not shown.

BIN
SFX/spawn_7.ogg Normal file

Binary file not shown.

View File

@@ -44,21 +44,6 @@ back.rgb={
)
end,
}--Changing pure color
back.strap={
init=function()
t=0
end,
update=function(dt)
t=t+dt
end,
draw=function()
SHADER.strap:send("t",t*.626)
gc.setColor(.4,.626,.626)
gc.setShader(SHADER.strap)
gc.rectangle("fill",0,0,scr.w,scr.h)
gc.setShader()
end,
}--Horizonal ranbow
back.flink={
init=function()
t=0
@@ -95,78 +80,77 @@ back.aura={
back.game1={
init=function()
t=0
BG.resize(scr.w,scr.h)
BG.resize(scr.w)
end,
resize=function(w,h)
SHADER.rainbow:send("w",w*scr.dpi)
SHADER.rainbow:send("h",h*scr.dpi)
resize=function(w)
SHADER.gradient1:send("w",w*scr.dpi)
end,
update=function(dt)
t=t+dt
end,
draw=function()
SHADER.rainbow:send("t",t)
gc.setColor(.6,.6,.6)
gc.setShader(SHADER.rainbow)
SHADER.gradient1:send("t",t)
gc.setShader(SHADER.gradient1)
gc.rectangle("fill",0,0,scr.w,scr.h)
gc.setShader()
end,
}--Rolling rainbow
}--Horizonal red-blue gradient
back.game2={
init=function()
t=0
BG.resize(scr.w,scr.h)
BG.resize(nil,scr.h)
end,
resize=function(w,h)
SHADER.rainbow:send("w",w*scr.dpi)
SHADER.rainbow:send("h",h*scr.dpi)
SHADER.gradient2:send("h",h*scr.dpi)
end,
update=function(dt)
t=t+dt
end,
draw=function()
SHADER.rainbow:send("t",t)
gc.setColor(.7,.4,.4)
gc.setShader(SHADER.rainbow)
SHADER.gradient2:send("t",t)
gc.setShader(SHADER.gradient2)
gc.rectangle("fill",0,0,scr.w,scr.h)
gc.setShader()
end,
}--Red rolling rainbow
}--Vertical red-green gradient
back.game3={
init=function()
t=0
BG.resize(scr.w,scr.h)
end,
resize=function(w,h)
SHADER.rainbow:send("w",w*scr.dpi)
SHADER.rainbow:send("h",h*scr.dpi)
SHADER.rgb1:send("w",w*scr.dpi)
SHADER.rgb1:send("h",h*scr.dpi)
end,
update=function(dt)
t=t+dt
end,
draw=function()
SHADER.rainbow:send("t",t)
gc.setColor(.5,.5,.8)
gc.setShader(SHADER.rainbow)
SHADER.rgb1:send("t",t)
gc.setShader(SHADER.rgb1)
gc.rectangle("fill",0,0,scr.w,scr.h)
gc.setShader()
end,
}--Blue rolling rainbow
}--Colorful RGB
back.game4={
init=function()
t=0
BG.resize(scr.w,scr.h)
end,
resize=function(w,h)
SHADER.rgb2:send("w",w*scr.dpi)
SHADER.rgb2:send("h",h*scr.dpi)
end,
update=function(dt)
t=t+dt
end,
draw=function()
SHADER.strap:send("t",t*1.26)
gc.setColor(.5,.626,.74)
gc.setShader(SHADER.strap)
SHADER.rgb2:send("t",t)
gc.setShader(SHADER.rgb2)
gc.rectangle("fill",0,0,scr.w,scr.h)
gc.setShader()
end,
}--Blue strap
}--Blue RGB
back.game5={
init=function()
t=0
@@ -189,7 +173,7 @@ back.game6={
t=0
colorLib=_G.SKIN.libColor
colorSet=_G.setting.skin
miniBlock=_G.miniBlock
blockImg=_G.TEXTURE.miniBlock
end,
update=function(dt)
t=t+dt
@@ -202,7 +186,7 @@ back.game6={
local R=7-int(t*.5)%7
local _=colorLib[colorSet[R]]
gc.setColor(_[1],_[2],_[3],.1)
gc.draw(miniBlock[R],640,360,t%3.1416*6,400,400,scs[R][0][2]-.5,#blocks[R][0]-scs[R][0][1]+.5)
gc.draw(blockImg[R],640,360,t%3.1416*6,400,400,scs[R][0][2]-.5,#blocks[R][0]-scs[R][0][1]+.5)
end,
}--Fast lightning + spining tetromino
@@ -284,7 +268,7 @@ BG={
update=NULL,
draw=back.none.draw,
}
function BG.set(bg)
function BG.set(bg,data)
if bg==BG.cur or not setting.bg then return end
if BG.discard then
BG.discard()

View File

@@ -1,5 +1,22 @@
local min=math.min
local rem=table.remove
local function fadeOut(id)
local src=BGM.list[id]
local v=src:getVolume()-.025*setting.bgm*.1
src:setVolume(v>0 and v or 0)
if v<=0 then
src:stop()
return true
end
end
local function fadeIn(id)
local src=BGM.list[id]
local v=min(src:getVolume()+.025*setting.bgm*.1,setting.bgm*.1)
src:setVolume(v)
if v>=setting.bgm*.1 then return true end
end
local BGM={
--nowPlay=[str:playing ID]
--suspend=[str:pausing ID]
@@ -10,6 +27,7 @@ BGM.list={
"secret7th","secret8th",
"shining terminal","oxygen","distortion","far",
"rockblock","cruelty","final","8-bit happiness","end",
"how feeling",
}
BGM.len=#BGM.list
function BGM.loadOne(N)
@@ -35,12 +53,12 @@ function BGM.play(s)
return
end
if BGM.nowPlay~=s then
if BGM.nowPlay then TASK.new(tickEvent.bgmFadeOut,nil,BGM.nowPlay)end
TASK.changeCode(tickEvent.bgmFadeIn,tickEvent.bgmFadeOut)
if BGM.nowPlay then TASK.new(fadeOut,BGM.nowPlay)end
TASK.changeCode(fadeIn,fadeOut)
TASK.removeTask_data(s)
BGM.nowPlay,BGM.suspend=s
TASK.new(tickEvent.bgmFadeIn,nil,s)
TASK.new(fadeIn,s)
BGM.playing=BGM.list[s]
BGM.playing:play()
end
@@ -63,9 +81,9 @@ function BGM.freshVolume()
end
function BGM.stop()
if BGM.nowPlay then
TASK.new(tickEvent.bgmFadeOut,nil,BGM.nowPlay)
TASK.new(fadeOut,BGM.nowPlay)
end
TASK.changeCode(tickEvent.bgmFadeIn,tickEvent.bgmFadeOut)
TASK.changeCode(fadeIn,fadeOut)
BGM.playing,BGM.nowPlay=nil
end
return BGM

39
Zframework/color.lua Normal file
View File

@@ -0,0 +1,39 @@
local color={
red={1,0,0},
green={0,1,0},
blue={.2,.2,1},
yellow={1,1,0},
magenta={1,0,1},
cyan={0,1,1},
grey={.6,.6,.6},
lRed={1,.5,.5},
lGreen={.5,1,.5},
lBlue={.6,.6,1},
lCyan={.5,1,1},
lMagenta={1,.5,1},
lYellow={1,1,.5},
lPurple={.8,.4,1},
lOrange={1,.7,.3},
lGrey={.8,.8,.8},
dRed={.6,0,0},
dGreen={0,.6,0},
dBlue={0,0,.6},
dCyan={0,.6,.6},
dMagenta={.6,0,.6},
dYellow={.6,.6,0},
dPurple={.3,0,.6},
dOrange={.6,.4,0},
dGrey={.3,.3,.3},
black={0,0,0},
orange={1,.6,0},
pink={1,0,.6},
grass={.6,1,0},
water={0,1,.6},
bronze={.7,.4,0},
white={1,1,1},
purple={.5,0,1},
}
return color

View File

@@ -15,7 +15,7 @@ local function splitS(s,sep)
return t
end
local tabs={
[0]="",
[0]="",
"\t",
"\t\t",
"\t\t\t",
@@ -39,7 +39,12 @@ local function dumpTable(L,t)
else
k="["..k.."]="
end
elseif T=="string"then k=k.."="
elseif T=="string"then
if find(k,"[^0-9a-zA-Z_]")then
k="[\""..k.."\"]="
else
k=k.."="
end
elseif T=="boolean"then k="["..k.."]="
else assert(false,"Error key type!")
end
@@ -136,79 +141,6 @@ function File.loadData()
if s then
setfenv(s,{})
local S=s()
if not S.version or S.version=="Alpha V0.8.15"then
S.clear_S={S.clear_1,S.clear_2,S.clear_3,S.clear_4}
S.clear={{},{},{},{},{},{},{}}
local A,B,C,D=int(S.clear_1/7),int(S.clear_2/7),int(S.clear_3/7),S.clear_4
for i=1,7 do
S.clear[i][1]=A
S.clear[i][2]=B
S.clear[i][3]=C
S.clear[i][4]=0
end
S.clear[7][4]=D
for i=1,S.clear_1%7 do S.clear[i][1]=S.clear[i][1]+1 end
for i=1,S.clear_2%7 do S.clear[i][2]=S.clear[i][2]+1 end
for i=1,S.clear_3%7 do S.clear[i][3]=S.clear[i][3]+1 end
S.clear_B={}
for i=1,7 do
S.clear_B[i]=S.clear[i][1]+S.clear[i][2]+S.clear[i][3]+S.clear[i][4]
end
S.spin_S={S.spin_0,S.spin_1,S.spin_2,S.spin_3}
S.spin={{},{},{},{},{},{},{}}
A,B,C,D=int(S.spin_0/7),int(S.spin_1/7),int(S.spin_2/7),int(S.spin_3/7)
for i=1,7 do
S.spin[i][1]=A
S.spin[i][2]=B
S.spin[i][3]=C
S.spin[i][4]=D
end
for i=1,S.spin_0%7 do S.spin[i][1]=S.spin[i][1]+1 end
for i=1,S.spin_1%7 do S.spin[i][2]=S.spin[i][2]+1 end
for i=1,S.spin_2%7 do S.spin[i][3]=S.spin[i][3]+1 end
for i=1,S.spin_3%7 do S.spin[i][4]=S.spin[i][4]+1 end
S.spin_B={}
for i=1,7 do
S.spin_B[i]=S.spin[i][1]+S.spin[i][2]+S.spin[i][3]+S.spin[i][4]
end
S.hpc=S.c
elseif S.version=="Alpha V0.8.16"then
for i=1,6 do
S.clear[7][4]=S.clear[7][4]+S.clear[i][4]
S.clear[i][4]=0
end
end
if not S.clear_B[8]then
for i=1,7 do
S.clear[i][5]=0
S.spin[i][5]=0
end
for i=8,25 do
S.clear[i]={0,0,0,0,0}
S.spin[i]={0,0,0,0,0}
S.spin_B[i]=0
S.clear_B[i]=0
end
S.spin_S[5]=0
S.clear_S[5]=0
end
if S.version=="Alpha V0.8.18"or S.version=="Alpha V0.8.19"then
S.clear[3],S.clear[4]=S.clear[4],S.clear[3]
S.spin[3],S.spin[4]=S.spin[4],S.spin[3]
S.clear_B[3],S.clear_B[4]=S.clear_B[4],S.clear_B[3]
S.spin_B[3],S.spin_B[4]=S.spin_B[4],S.spin_B[3]
end
if #modeRanks==76 then
for i=1,4 do
table.remove(modeRanks)
end
end
if S.version~=gameVersion then
S.version=gameVersion
TEXT.show(text.newVersion,640,200,30,"fly",.3)
end
addToTable(S,stat)
end
end

View File

@@ -1,7 +1,7 @@
local IMG={
batteryImage="/mess/power.png",
titleImage="mess/title.png",
coloredTitleImage="mess/title_colored.png",
title="mess/title.png",
title_color="mess/title_colored.png",
dialCircle="mess/dialCircle.png",
dialNeedle="mess/dialNeedle.png",
badgeIcon="mess/badge.png",
@@ -18,6 +18,7 @@ local IMG={
miyaF4="miya/f4.png",
electric="mess/electric.png",
hbm="mess/hbm.png",
}
local list={}
local count=0

View File

@@ -1,13 +1,30 @@
require("Zframework/toolfunc")
color= require("Zframework/color")
SHADER= require("Zframework/shader")
VIB= require("Zframework/vib")
SFX= require("Zframework/sfx")
sysFX= require("Zframework/sysFX")
BG= require("Zframework/bg")
BGM= require("Zframework/bgm")
VOC= require("Zframework/voice")
LANG= require("Zframework/languages")
FILE= require("Zframework/file")
TEXT= require("Zframework/text")
TASK= require("Zframework/task")
IMG= require("Zframework/img")
WIDGET= require("Zframework/widget")
Widgets=require("Zframework/widgetList")
LIGHT= require("Zframework/light")
SCN= require("Zframework/scene")
local Tmr=require("Zframework/timer")
local Pnt=require("Zframework/paint")
local ms,kb,tc=love.mouse,love.keyboard,love.touch
local gc,sys=love.graphics,love.system
local Timer=love.timer.getTime
local int,rnd,max,min=math.floor,math.random,math.max,math.min
local abs=math.abs
local rem=table.remove
kb.setKeyRepeat(true)
kb.setTextInput(false)
ms.setVisible(false)
local ins,rem=table.insert,table.remove
local scr=scr
local xOy=love.math.newTransform()
@@ -17,10 +34,6 @@ local touchDist=nil
joysticks={}
local devMode
players={alive={},human=0}
local Tmr=require("timer")
local Pnt=require("paint")
local infoCanvas=gc.newCanvas(108,27)
local function updatePowerInfo()
@@ -115,12 +128,14 @@ local keyDown,keyUp={},{}
local gamepadDown,gamepadUp={},{}
function keyDown.load(k)
if k=="s"then
if k=="a"then
sceneTemp.skip=true
elseif k=="s"then
marking=nil
sceneTemp.skip=true
end
end
function touchDown.load()
function touchDown.load(id,x,y)
if #tc.getTouches()==2 then
sceneTemp.skip=true
end
@@ -131,21 +146,18 @@ function mouseDown.intro(x,y,k)
VOC.play("bye")
SCN.back()
else
SCN.push()
SCN.swapTo("main")
SCN.goto("main")
end
end
function touchDown.intro(id,x,y)
SCN.push()
SCN.swapTo("main")
SCN.goto("main")
end
function keyDown.intro(key)
if key=="escape"then
VOC.play("bye")
SCN.back()
else
SCN.push()
SCN.swapTo("main")
SCN.goto("main")
end
end
@@ -153,17 +165,15 @@ local function onMode(x,y)
local cam=mapCam
x=(cam.x1-640+x)/cam.k1
y=(cam.y1-360+y)/cam.k1
local MM,R=modes,modeRanks
for _=1,#MM do
if R[_]then
local M=MM[_]
for name,M in next,Modes do
if modeRanks[name]then
local s=M.size
if M.shape==1 then
if x>M.x-s and x<M.x+s and y>M.y-s and y<M.y+s then return _ end
if x>M.x-s and x<M.x+s and y>M.y-s and y<M.y+s then return name end
elseif M.shape==2 then
if abs(x-M.x)+abs(y-M.y)<s then return _ end
if abs(x-M.x)+abs(y-M.y)<s then return name end
elseif M.shape==3 then
if(x-M.x)^2+(y-M.y)^2<s^2 then return _ end
if(x-M.x)^2+(y-M.y)^2<s^2 then return name end
end
end
end
@@ -193,20 +203,22 @@ end
function mouseClick.mode(x,y,k)
local cam=mapCam
local _=cam.sel
if not cam.sel or x<920 then
local __=onMode(x,y)
if _~=__ then
if __ then
if not _ or x<920 then
local SEL=onMode(x,y)
if _~=SEL then
if SEL then
SFX.play("click")
cam.moving=true
_=modes[__]
_=Modes[SEL]
cam.x=_.x*cam.k+180
cam.y=_.y*cam.k
cam.sel=__
cam.sel=SEL
else
cam.sel=nil
cam.x=cam.x-180
end
elseif _ then
keyDown.mode("return")
end
end
cam.keyCtrl=false
@@ -235,8 +247,20 @@ end
function keyDown.mode(key)
if key=="return"then
if mapCam.sel then
if mapCam.sel=="custom_clear"or mapCam.sel=="custom_puzzle"then
if customSel[11]>1 then
if customSel[7]==5 then
TEXT.show(text.ai_fixed,640,360,50,"appear")
return
elseif #preBag>0 then
TEXT.show(text.ai_prebag,640,360,50,"appear")
return
end
end
end
mapCam.keyCtrl=false
SCN.push()loadGame(mapCam.sel)
SCN.push()
loadGame(mapCam.sel)
end
elseif key=="escape"then
if mapCam.sel then
@@ -244,11 +268,9 @@ function keyDown.mode(key)
else
SCN.back()
end
elseif mapCam.sel==71 or mapCam.sel==72 then
if key=="q"then
SCN.push()SCN.swapTo("draw")
elseif key=="e"then
SCN.push()SCN.swapTo("custom")
elseif mapCam.sel=="custom_clear" or mapCam.sel=="custom_puzzle" then
if key=="e"then
SCN.goto("custom")
end
end
end
@@ -280,8 +302,8 @@ end
local customSet={
{3,20,1,1,7,1,1,1,3,4,1,2,3},
{5,20,1,1,7,1,1,1,8,3,8,3,3},
{1,22,1,1,7,3,1,1,8,4,1,7,7},
{3,20,1,1,7,1,1,3,8,3,1,7,8},
{1,22,1,1,7,3,1,1,8,4,1,6,7},
{3,20,1,1,7,1,1,3,8,3,1,6,8},
{25,11,8,11,4,1,2,1,8,3,1,4,9},
}
function keyDown.custom(key)
@@ -304,6 +326,10 @@ function keyDown.custom(key)
elseif sel==13 then
BGM.play(customRange.bgm[customSel[sel]])
end
elseif key=="q"then
SCN.goto("sequence")
elseif key=="e"then
SCN.swapTo("draw")
elseif #key==1 then
local T=tonumber(key)
if T and T>=1 and T<=5 then
@@ -318,6 +344,54 @@ function keyDown.custom(key)
end
end
local minoKey={
["1"]=1,["2"]=2,["3"]=3,["4"]=4,["5"]=5,["6"]=6,["7"]=7,
z=1,s=2,j=3,l=4,t=5,o=6,i=7,
p=10,q=11,f=12,e=13,u=15,
v=16,w=17,x=18,r=21,y=22,n=23,h=24,
}
local minoKey2={
["1"]=8,["2"]=9,["3"]=19,["4"]=20,["5"]=14,["7"]=25,
z=8,s=9,t=14,j=19,l=20,i=25
}
function keyDown.sequence(key)
local s=sceneTemp
if type(key)=="number"then
local C=s.cur+1
ins(preBag,C,key)
s.cur=C
elseif #key==1 then
local i=(kb.isDown("lctrl","lshift","lalt","rctrl","rshift","ralt")and minoKey2 or minoKey)[key]
if i then
local C=s.cur+1
ins(preBag,C,i)
s.cur=C
end
else
if key=="left"then
if s.cur>0 then s.cur=s.cur-1 end
elseif key=="right"then
if s.cur<#preBag then s.cur=s.cur+1 end
elseif key=="backspace"then
local C=s.cur
if C>0 then
rem(preBag,C)
s.cur=C-1
end
elseif key=="escape"then
SCN.back()
elseif key=="delete"then
if sceneTemp.sure>20 then
preBag={}
sceneTemp.cur=0
sceneTemp.sure=0
else
sceneTemp.sure=50
end
end
end
end
function mouseDown.draw(x,y,k)
mouseMove.draw(x,y)
end
@@ -382,6 +456,8 @@ function keyDown.draw(key)
if sx and sy then
preField[sy][sx]=pen
end
elseif key=="e"then
SCN.swapTo("custom")
elseif key=="escape"then
SCN.back()
elseif key=="c"and kb.isDown("lctrl","rctrl")then
@@ -395,25 +471,13 @@ function keyDown.draw(key)
end
function mouseDown.setting_sound(x,y,k)
if x>780 and x<980 and y>470 and sceneTemp.jump==0 then
sceneTemp.jump=10
local t=Timer()-sceneTemp.last
local s=sceneTemp
if x>780 and x<980 and y>470 and s.jump==0 then
s.jump=10
local t=Timer()-s.last
if t>1 then
VOC.play((t<1.5 or t>15)and"doubt"or rnd()<.8 and"happy"or"egg")
sceneTemp.last=Timer()
if rnd()<.0626 then
for i=1,#modes do
local M=modes[i]
for i=1,#M.unlock do
local m=M.unlock[i]
if not modeRanks[m]then
modeRanks[m]=modes[m].score and 0 or 6
end
end
end
FILE.saveUnlock()
TEXT.show("DEVMODE:UNLOCKALL",640,360,50,"stretch",.6)
end
s.last=Timer()
end
end
end
@@ -532,8 +596,7 @@ function keyDown.pause(key)
elseif key=="escape"then
resumeGame()
elseif key=="s"then
SCN.push()
SCN.swapTo("setting_sound")
SCN.goto("setting_sound")
elseif key=="r"then
TASK.clear("play")
mergeStat(stat,players[1].stat)
@@ -649,7 +712,16 @@ function gamepadUp.play(key)
end
end
function touchDown.help(id,x,y)
function keyDown.staff(key,RESET)
if key=="escape"then
SCN.back()
elseif key=="\122"then
if RESET or kb.isDown("\109")and kb.isDown("\114")then
SCN.goto("debug")
end
end
end
function touchDown.staff(id,x,y)
local pw=sceneTemp.pw
local t=pw%4
if
@@ -660,8 +732,7 @@ function touchDown.help(id,x,y)
then
pw=pw+1
if pw==8 then
marking=nil
SFX.play("reach")
SCN.goto("debug")
end
else
pw=x<640 and y<360==1 and 1 or 0
@@ -669,18 +740,6 @@ function touchDown.help(id,x,y)
sceneTemp.pw=pw
end
function keyDown.staff(key)
if key=="escape"then
SCN.back()
elseif key=="\122"then
if kb.isDown("\109")and kb.isDown("\114")then
sceneTemp.v=-2.6
marking=nil
SFX.play("reach")
end
end
end
function wheelMoved.history(x,y)
wheelScroll(y)
end
@@ -790,8 +849,19 @@ function love.touchreleased(id,x,y)
end
function love.keypressed(i)
mouseShow=false
if SCN.swapping then return end
if devMode then
if not devMode then
if i~="f8"then
if SCN.swapping then return end
if keyDown[SCN.cur]then keyDown[SCN.cur](i)
elseif i=="escape"then SCN.back()
else WIDGET.keyPressed(i)
end
else
devMode=1
TEXT.show("DEBUG ON",640,360,80,"fly",.8)
end
else
if i=="f5"then
print("DEBUG:")
elseif i=="f8"then devMode=nil TEXT.show("DEBUG OFF",640,360,80,"fly",.8)
@@ -832,14 +902,6 @@ function love.keypressed(i)
end
end
end
elseif i=="f8"then
devMode=1
TEXT.show("DEBUG ON",640,360,80,"fly",.8)
else
if keyDown[SCN.cur]then keyDown[SCN.cur](i)
elseif i=="escape"then SCN.back()
else WIDGET.keyPressed(i)
end
end
end
function love.keyreleased(i)
@@ -926,30 +988,43 @@ function love.resize(w,h)
SHADER.warning:send("h",h*scr.dpi)
end
function love.focus(f)
if SCN.cur=="play"and not f and setting.autoPause then pauseGame()end
if f then
TASK.new(TICK.autoResize,{0})
love.timer.step()
elseif SCN.cur=="play"and setting.autoPause then
pauseGame()
end
end
local scs={1,2,1,2,1,2,1,2,1,2,1.5,1.5,.5,2.5}
local devColor={
color.white,
color.lightMagenta,
color.lightGreen,
color.lightBlue,
color.lMagenta,
color.lGreen,
color.lBlue,
}
local FPS=love.timer.getFPS
love.draw,love.update=nil
function love.run()
local T=love.timer
local STEP,GETDelta,WAIT=T.step,T.getDelta,T.sleep
local mini=love.window.isMinimized
local PUMP,POLL=love.event.pump,love.event.poll
local waitTime=1/60
local LIST={}
local lastFrame=T.getTime()
local lastFreshPow=lastFrame
local FCT=0--framedraw counter
local mini=love.window.isMinimized
local PUMP,POLL=love.event.pump,love.event.poll
love.resize(gc.getWidth(),gc.getHeight())
SCN.init("load")--Scene Launch
marking=true
return function()
local _
lastFrame=Timer()
--EVENT
PUMP()
for N,a,b,c,d,e in POLL()do
@@ -962,7 +1037,8 @@ function love.run()
end
--UPDATE
STEP()local dt=GETDelta()
STEP()
local dt=GETDelta()
TASK.update()
VOC.update()
BG.update(dt)
@@ -982,36 +1058,46 @@ function love.run()
BG.draw()
gc.push("transform")
gc.replaceTransform(xOy)
--Draw scene contents
if Pnt[SCN.cur]then Pnt[SCN.cur]()end
WIDGET.draw()--Draw widgets
--Draw widgets
WIDGET.draw()
--Draw cursor
if mouseShow then
local r=Timer()*.5
local R=int(r)%7+1
_=SKIN.libColor[setting.skin[R]]
gc.setColor(_[1],_[2],_[3],min(1-abs(1-r%1*2),.3))
gc.draw(miniBlock[R],mx,my,Timer()%3.1416*4,20,20,scs[2*R]-.5,#blocks[R][0]-scs[2*R-1]+.5)
gc.draw(TEXTURE.miniBlock[R],mx,my,Timer()%3.1416*4,20,20,scs[2*R]-.5,#blocks[R][0]-scs[2*R-1]+.5)
gc.setColor(1,1,1,.5)gc.circle("fill",mx,my,5)
gc.setColor(1,1,1)gc.circle("fill",mx,my,3)
end--Awesome mouse!
end
sysFX.draw()
TEXT.draw()
gc.pop()
--Draw power info.
gc.setColor(1,1,1)
if setting.powerInfo then
gc.draw(infoCanvas,0,0,0,scr.k)
end
--Power Info
--Draw scene swapping animation
if SCN.swapping then
_=SCN.swap
_.draw(_.time)
end--Scene swapping animation
end
setFont(15)
--Draw FPS
gc.setColor(1,1,1)
setFont(15)
_=scr.h-20
gc.print(FPS(),5,_)
--Debug info.
if devMode then
gc.setColor(devColor[devMode])
gc.print("Cache used:"..gcinfo(),5,_-20)
@@ -1019,21 +1105,26 @@ function love.run()
gc.print("Mouse:"..mx.." "..my,5,_-60)
gc.print("Voices:"..VOC.getCount(),5,_-80)
gc.print("Tasks:"..TASK.getCount(),5,_-100)
ins(LIST,1,dt)
rem(LIST,126)
for i=1,#LIST do
gc.rectangle("fill",900+2*i,_,2,-LIST[i]*4000)
end
if devMode==3 then love.timer.sleep(.26)
elseif devMode==4 then love.timer.sleep(.626)
end
end--DEV info
end
gc.present()
end
end
--FRAME TIME CTRL
if Timer()-lastFrame<.058 then WAIT(.01)end
while Timer()-lastFrame<.0159 do WAIT(.001)end
--Keep 60fps
if FPS()>60 then
WAIT(1/60+lastFrame-Timer())
end
--FRESH POWERINFO
lastFrame=Timer()
--Fresh power info.
if Timer()-lastFreshPow>3 and setting.powerInfo and SCN.cur~="load"then
updatePowerInfo()
lastFreshPow=Timer()

File diff suppressed because it is too large Load Diff

View File

@@ -3,8 +3,8 @@
--https://github.com/mattdesl/lwjgl-basics/wiki/2D-Pixel-Perfect-Shadows
local gc=love.graphics
local C=gc.clear
local shadowMapShader=gc.newShader("shader/shadowMap.glsl")--Shader for caculating the 1D shadow map.
local lightRenderShader=gc.newShader("shader/lightRender.glsl")--Shader for rendering blurred lights and shadows.
local shadowMapShader=gc.newShader("Zframework/shader/shadowMap.glsl")--Shader for caculating the 1D shadow map.
local lightRenderShader=gc.newShader("Zframework/shader/lightRender.glsl")--Shader for rendering blurred lights and shadows.
local Lights={}--Lightsource objects
local function move(L,x,y)
L.x,L.y=x,y

View File

@@ -9,12 +9,12 @@ local mStr=mStr
local scr=scr
local scs=require("parts/spinCenters")
local modeRankColor={
color.bronze, --Rank1
color.lightGrey, --Rank2
color.lightYellow, --Rank3
color.lightPurple, --Rank4
color.lightCyan, --Rank5
color.purple, --Special
color.bronze, --Rank1
color.lGrey, --Rank2
color.lYellow, --Rank3
color.lPurple, --Rank4
color.lCyan, --Rank5
color.lGreen, --Special
}
local rankString={
"D","C","B","A","S",
@@ -29,13 +29,6 @@ local miniTitle_rect={
{14,8,1,6},{19,8,1,6},{15,9,1,1},{16,10,1,1},{17,11,1,1},{18,12,1,1},
{21,8,5,1},{21,13,5,1},{21,9,1,4},{25,9,1,4},
}
local function stencil_miniTitle()
for i=1,#miniTitle_rect do
local a,b,c,d=unpack(miniTitle_rect[i])
gc.rectangle("fill",250+a*30,150+b*30,c*30,d*30)
end
end
FX_attack={}--Attack beam
FX_badge={}--Badge thrown
local function drawAtkPointer(x,y)
@@ -55,7 +48,7 @@ local function VirtualkeyPreview()
gc.setColor(c,1,c,setting.VKAlpha*.1)
gc.setLineWidth(B.r*.07)
gc.circle("line",B.x,B.y,B.r,10)
if setting.VKIcon then gc.draw(VKIcon[i],B.x,B.y,nil,B.r*.025,nil,18,18)end
if setting.VKIcon then gc.draw(TEXTURE.VKIcon[i],B.x,B.y,nil,B.r*.025,nil,18,18)end
end
end
end
@@ -65,6 +58,7 @@ local function drawVirtualkey()
local a=setting.VKAlpha*.1
local _
if setting.VKIcon then
local icons=TEXTURE.VKIcon
for i=1,#V do
if V[i].ava then
local B=V[i]
@@ -72,7 +66,7 @@ local function drawVirtualkey()
gc.setLineWidth(B.r*.07)
gc.circle("line",B.x,B.y,B.r,10)--Button outline
_=V[i].pressTime
gc.draw(VKIcon[i],B.x,B.y,nil,B.r*.026+_*.08,nil,18,18)--icon
gc.draw(icons[i],B.x,B.y,nil,B.r*.026+_*.08,nil,18,18)--icon
if _>0 then
gc.setColor(1,1,1,a*_*.08)
gc.circle("fill",B.x,B.y,B.r*.94,10)--Glow
@@ -115,33 +109,69 @@ function Pnt.load()
setFont(25)
mStr(S.tip,640,400)
end
local titleTransform={
function(t)
gc.translate(0,max(50-t,0)^2/25)
end,
function(t)
gc.translate(0,-max(50-t,0)^2/25)
end,
function(t,i)
local d=max(50-t,0)
gc.translate(sin(Timer()*3+626*i)*d,cos(Timer()*3+626*i)*d)
end,
function(t,i)
local d=max(50-t,0)
gc.translate(sin(Timer()*3+626*i)*d,-cos(Timer()*3+626*i)*d)
end,
function(t)
gc.setColor(1,1,1,min(t*.02,1)+rnd()*.2)
end,
}
function Pnt.intro()
local T=sceneTemp
gc.stencil(stencil_miniTitle,"replace",1)
gc.setStencilTest("equal",1)
gc.setColor(1,1,1,min(T,80)*.005)
gc.push("transform")
gc.translate(250,150)
gc.scale(30)
gc.rectangle("fill",0,0,26,14)
gc.pop()
gc.setColor(1,1,1,.06)
for i=41,5,-2 do
gc.setLineWidth(i)
gc.line(200+(T-80)*25,130,(T-80)*25,590)
local s=sceneTemp
local t=s.t1
local T=(t+110)%300
if T<30 then
gc.setLineWidth(4+(30-T)^1.626/62)
else
gc.setLineWidth(4)
end
local L=title
gc.push("transform")
gc.translate(126,226)
for i=1,8 do
local T=t-i*15
if T>0 then
gc.push("transform")
gc.setColor(1,1,1,min(T*.025,1))
titleTransform[s.r[i]](T,i)
local dt=(t+62-5*i)%300
if dt<20 then
gc.translate(0,abs(10-dt)-10)
end
gc.polygon("line",L[i])
gc.pop()
end
gc.setStencilTest()
if T>=80 then
gc.setColor(1,1,1,.5+sin((T-95)/30*3.142)*.5)
end
gc.pop()
t=s.t2
if t>=80 then
gc.setColor(1,1,1,.6+sin((t-80)*.0626)*.3)
mText(drawableText.anykey,640,615+sin(Timer()*3)*5)
end
end
function Pnt.main()
gc.setColor(1,1,1)
gc.draw(IMG.coloredTitleImage,60,30,nil,1.3)
gc.draw(IMG.title_color,60,30,nil,1.3)
setFont(30)
gc.print(gameVersion,70,125)
gc.print(system,610,100)
local L=text.modes[stat.lastPlay]
setFont(25)
gc.print(L[1],700,470)
gc.print(L[2],700,500)
players[1]:draw()
end
function Pnt.mode()
@@ -152,59 +182,60 @@ function Pnt.mode()
gc.scale(cam.zoomK)
gc.translate(-cam.x1,-cam.y1)
gc.scale(cam.k1)
local MM=modes
local R=modeRanks
local sel=cam.sel
setFont(30)
for _=1,#MM do
local M=MM[_]
if R[_]then
gc.setLineWidth(8)
gc.setColor(1,1,1,.2)
gc.setLineWidth(8)
gc.setColor(1,1,1,.2)
for name,M in next,Modes do
if R[name]then
for _=1,#M.unlock do
local m=M.unlock[_]
m=MM[m]
local m=Modes[M.unlock[_]]
gc.line(M.x,M.y,m.x,m.y)
end
end
end--lines connecting modes
for name,M in next,Modes do
if R[name]then
local S=M.size
local d=((M.x-(cam.x1+(sel and -180 or 0))/cam.k1)^2+(M.y-cam.y1/cam.k1)^2)^.55
if d<500 then S=S*(1.25-d*0.0005) end
local c=modeRankColor[modeRanks[M.id]]
local c=modeRankColor[R[M.name]]
if c then
gc.setColor(c)
else
c=.5+sin(Timer()*6.26-_)*.2
c=.5+sin(Timer()*6.26)*.2
S=S*(.9+c*.4)
gc.setColor(c,c,c)
end
if M.shape==1 then--Rectangle
gc.rectangle("fill",M.x-S,M.y-S,2*S,2*S)
if sel==_ then
if sel==name then
gc.setColor(1,1,1)
gc.setLineWidth(10)
gc.rectangle("line",M.x-S+5,M.y-S+5,2*S-10,2*S-10)
end
elseif M.shape==2 then--diamond
gc.circle("fill",M.x,M.y,S+5,4)
if sel==_ then
if sel==name then
gc.setColor(1,1,1)
gc.setLineWidth(10)
gc.circle("line",M.x,M.y,S+5,4)
end
elseif M.shape==3 then--Octagon
gc.circle("fill",M.x,M.y,S,8)
if sel==_ then
if sel==name then
gc.setColor(1,1,1)
gc.setLineWidth(10)
gc.circle("line",M.x,M.y,S,8)
end
end
_=drawableText[rankString[modeRanks[M.id]]]
if _ then
local dx,dy=6.26*sin(Timer()*0.626+M.id),6.6*sin(Timer()+M.id)
name=drawableText[rankString[R[M.name]]]
if name then
gc.setColor(0,0,0,.26)
mDraw(_,M.x+dx*1.5,M.y+dy*1.5)
mDraw(name,M.x,M.y)
end
--[[
if M.icon then
@@ -224,7 +255,7 @@ function Pnt.mode()
end
gc.pop()
if sel then
local M=MM[sel]
local M=Modes[sel]
local lang=setting.lang
gc.setColor(.7,.7,.7,.5)
gc.rectangle("fill",920,0,360,720)--Info board
@@ -264,7 +295,7 @@ function Pnt.mode()
end
if cam.keyCtrl then
gc.setColor(1,1,1)
gc.draw(mapCross,460-20,360-20)
gc.draw(TEXTURE.mapCross,460-20,360-20)
end
end
function Pnt.music()
@@ -279,7 +310,7 @@ function Pnt.music()
for i=1,BGM.len do
gc.print(BGM.list[i],50,90+30*i)
end
gc.draw(IMG.titleImage,640,310,nil,1.5,nil,206,35)
gc.draw(IMG.title,640,310,nil,1.5,nil,206,35)
if BGM.nowPlay then
setFont(45)
gc.setColor(sin(Timer()*.5)*.2+.8,sin(Timer()*.7)*.2+.8,sin(Timer())*.2+.8)
@@ -287,27 +318,65 @@ function Pnt.music()
local t=-Timer()%2.3/2
if t<1 then
gc.setColor(1,1,1,t)
gc.draw(IMG.coloredTitleImage,640,310,nil,1.5+.1-.1*t,1.5+.3-.3*t,206,35)
gc.draw(IMG.title_color,640,310,nil,1.5+.1-.1*t,1.5+.3-.3*t,206,35)
end
end
end
function Pnt.custom()
gc.setColor(1,1,1,.3+sin(Timer()*8)*.2)
gc.rectangle("fill",25,95+40*sceneTemp,480,40)
gc.setColor(.7,.7,.7)gc.draw(drawableText.custom,20,20)
gc.setColor(1,1,1)gc.draw(drawableText.custom,22,23)
gc.rectangle("fill",100,115+40*sceneTemp,570,40)
gc.setColor(.7,.7,.7)gc.draw(drawableText.custom,360,20)
gc.setColor(1,1,1)gc.draw(drawableText.custom,362,23)
setFont(35)
for i=1,#customID do
local k=customID[i]
local y=90+40*i
gc.printf(text.customOption[k],15,y,320,"right")
local y=110+40*i
gc.printf(text.customOption[k],100,y,320,"right")
if text.customVal[k]then
gc.print(text.customVal[k][customSel[i]],335,y)
gc.print(text.customVal[k][customSel[i]],440,y)
else
gc.print(customRange[k][customSel[i]],335,y)
gc.print(customRange[k][customSel[i]],440,y)
end
end
end
function Pnt.sequence()
local s=sceneTemp
gc.setColor(.7,.7,.7)gc.draw(drawableText.sequence,120,-15)
gc.setColor(1,1,1)gc.draw(drawableText.sequence,122,-12)
gc.setLineWidth(4)
gc.rectangle("line",100,100,1080,260)
setFont(30)
local bag=preBag
local len=#bag
setFont(40)
gc.print(len,120,300)
local L=TEXTURE.miniBlock
local x,y=120,126
local cx,cy=120,126
for i=1,len do
local B=L[bag[i]]
gc.draw(B,x,y,nil,15,15,0,B:getHeight()*.5)
x=x+B:getWidth()*15+10
if x>1126 then
x,y=120,y+50
end
if i==s.cur then
cx,cy=x,y
end
end
gc.setColor(.5,1,.5,.6+.4*sin(Timer()*6.26))
gc.line(cx-5,cy-20,cx-5,cy+20)
--Confirm reset
if s.sure>0 then
gc.setColor(1,1,1,s.sure*.02)
gc.draw(drawableText.question,1035,570)
end
end
function Pnt.draw()
local sx,sy=sceneTemp.x,sceneTemp.y
gc.translate(200,60)
@@ -333,6 +402,8 @@ function Pnt.draw()
gc.rectangle("line",30*sx-30,600-30*sy,30,30)
end
gc.translate(-200,-60)
--Pen
local pen=sceneTemp.pen
if pen>0 then
gc.setLineWidth(13)
@@ -344,10 +415,14 @@ function Pnt.draw()
gc.line(575,470,625,520)
gc.line(575,520,625,470)
end
--Confirm reset
if sceneTemp.sure>0 then
gc.setColor(1,1,1,sceneTemp.sure*.02)
gc.draw(drawableText.question,1040,430)
end
--Block name
setFont(40)
local _
for i=1,7 do
@@ -357,6 +432,12 @@ function Pnt.draw()
end
end
function Pnt.play()
if marking then
setFont(26)
local t=Timer()
gc.setColor(1,1,1,.2+.1*(sin(3*t)+sin(2.6*t)))
mStr(text.marking,190,60+26*sin(t))
end
for p=1,#players do
players[p]:draw()
end
@@ -414,11 +495,18 @@ function Pnt.play()
end
end
end
--Mode info
gc.setColor(1,1,1,.8)
gc.draw(drawableText.modeName,485,10)
gc.draw(drawableText.levelName,511+drawableText.modeName:getWidth(),10)
--Danger
gc.push("transform")
gc.origin()
if restartCount>0 then
gc.setColor(0,0,0,restartCount*.05)
gc.rectangle("fill",0,0,scr.w,scr.h)
gc.rectangle("fill",0,0,scr.w*scr.dpi,scr.h*scr.dpi)
end
if game.warnLVL>0 then
gc.setColor(0,0,0,0)
@@ -443,7 +531,7 @@ function Pnt.pause()
gc.setColor(.15,.15,.15,_)
gc.push("transform")
gc.origin()
gc.rectangle("fill",0,0,scr.w,scr.h)
gc.rectangle("fill",0,0,scr.w*scr.dpi,scr.h*scr.dpi)
gc.pop()
--Pause Info
@@ -465,29 +553,44 @@ function Pnt.pause()
mText(game.result and drawableText[game.result]or drawableText.pause,640,50-10*(5-sceneTemp.timer*.1)^1.5)
--Infos
if frame>180 then
if game.frame>180 then
_=S.list
setFont(26)
for i=1,10 do
gc.print(text.pauseStat[i],40,210+40*i)
gc.printf(_[i],245,210+40*i,250,"right")
gc.printf(_[i],195,210+40*i,300,"right")
end
end
--Radar Chart
if T>.5 and frame>180 then
if T>.5 and game.frame>180 then
T=T*2-1
gc.setLineWidth(2)
gc.push("transform")
gc.translate(1026,400)
--axes
--Polygon
gc.push("transform")
gc.scale((3-2*T)*T)
gc.setColor(1,1,1,T*(.5+.3*sin(Timer()*6.26)))gc.polygon("line",S.standard)
_=S.color
gc.setColor(_[1],_[2],_[3],T*.626)
_=S.val
for i=1,9,2 do
gc.polygon("fill",0,0,_[i],_[i+1],_[i+2],_[i+3])
end
gc.polygon("fill",0,0,_[11],_[12],_[1],_[2])
gc.setColor(1,1,1,T)gc.polygon("line",S.val)
gc.pop()
--Axes
gc.setColor(1,1,1,T)
for i=1,3 do
local x,y=hexList[2*i-1],hexList[2*i]
gc.line(-x,-y,x,y)
end
--Texts
local C
_=Timer()%6.2832
if _>3.1416 then
@@ -502,16 +605,6 @@ function Pnt.pause()
for i=1,6 do
mStr(C[i],_[2*i-1],_[2*i])
end
gc.scale((3-2*T)*T)
gc.setColor(1,1,1,T*(.5+.3*sin(Timer()*6.26)))gc.polygon("line",S.standard)
_=S.color
gc.setColor(_[1],_[2],_[3],T)
_=S.val
for i=1,9,2 do
gc.polygon("fill",0,0,_[i],_[i+1],_[i+2],_[i+3])
end
gc.polygon("fill",0,0,_[11],_[12],_[1],_[2])
gc.setColor(1,1,1,T)gc.polygon("line",S.val)
gc.pop()
end
end
@@ -641,7 +734,7 @@ function Pnt.setting_skin()
gc.circle("fill",-10+140*N,340,sin(Timer()*10)+5)
end
for i=1,6 do
gc.draw(blockSkin[11+i],1110,100+60*i,nil,2)
gc.draw(blockSkin[11+i],570+60*i,610,nil,2)
end
gc.draw(drawableText.setting_skin,80,50)
end
@@ -676,7 +769,7 @@ function Pnt.help()
end
setFont(19)
gc.print(text.used,30,330)
gc.draw(IMG.titleImage,280,610,.1,1+.05*sin(Timer()*2.6),nil,206,35)
gc.draw(IMG.title,280,610,.1,1+.05*sin(Timer()*2.6),nil,206,35)
gc.setLineWidth(3)
gc.rectangle("line",18,18,263,263)
gc.rectangle("line",1012,18,250,250)
@@ -692,18 +785,12 @@ end
function Pnt.staff()
local L=text.staff
local t=sceneTemp.time
if t>45 then t=45 end
if t>0 then
setFont(40)
for i=1,#L do
mStr(L[i],640,800+80*i-t*40)
end
mDraw(IMG.coloredTitleImage,640,800-t*40,nil,2)
mDraw(IMG.coloredTitleImage,640,2160-t*40,nil,2)
else
setFont(60)
mStr("Don't tell this to anyone.",640,-100-t*40)
setFont(40)
for i=1,#L do
mStr(L[i],640,800+80*i-t*40)
end
mDraw(IMG.title_color,640,800-t*40,nil,2)
mDraw(IMG.title_color,640,2160-t*40,nil,2)
end
function Pnt.stat()
local chart=sceneTemp.chart
@@ -746,7 +833,7 @@ function Pnt.stat()
gc.line(40,240+40*y,600,240+40*y)
end
gc.draw(IMG.titleImage,260,615,.2+.04*sin(Timer()*3),nil,nil,206,35)
gc.draw(IMG.title,260,615,.2+.04*sin(Timer()*3),nil,nil,206,35)
end
function Pnt.history()
gc.setColor(.2,.2,.2,.7)

View File

@@ -1,7 +1,7 @@
local gc=love.graphics
local int,log=math.floor,math.log
local sin,cos=math.sin,math.cos
local max,format=math.max,string.format
local int,max,log=math.floor,math.max,math.log
local rnd,sin,cos=math.random,math.sin,math.cos
local format=string.format
local scr=scr
local SCN={
cur="load",--Current scene
@@ -29,15 +29,22 @@ function sceneInit.load()
#BGM.list,
#SFX.list,
IMG.getCount(),
#modes,
#Modes,
1,
},
skip=false,--if skipping
skip=false,--If skipped
}
end
function sceneInit.intro()
BG.set("space")
sceneTemp=0--animation timer
sceneTemp={
t1=0,--Timer 1
t2=0,--Timer 2
r={},--Random animation type
}
for i=1,8 do
sceneTemp.r[i]=rnd(5)
end
BGM.play("blank")
end
function sceneInit.main()
@@ -47,13 +54,13 @@ function sceneInit.main()
modeEnv={}
if not players[1]then
PLY.newDemoPlayer(1,900,35,1.1)
end--create demo player
end--Create demo player
end
function sceneInit.music()
if BGM.nowPlay then
for i=1,BGM.len do
if BGM.list[i]==BGM.nowPlay then
sceneTemp=i--music select
sceneTemp=i--Music selected
return
end
end
@@ -68,17 +75,20 @@ function sceneInit.mode(org)
local cam=mapCam
cam.zoomK=org=="main"and 5 or 1
if cam.sel then
local M=modes[cam.sel]
local M=Modes[cam.sel]
cam.x,cam.y=M.x*cam.k+180,M.y*cam.k
cam.x1,cam.y1=cam.x,cam.y
end
end
function sceneInit.custom()
sceneTemp=1--option select
sceneTemp=1--Option selected
destroyPlayers()
BG.set(customRange.bg[customSel[12]])
BGM.play(customRange.bgm[customSel[13]])
end
function sceneInit.sequence()
sceneTemp={cur=#preBag,sure=0}
end
function sceneInit.draw()
BG.set("space")
sceneTemp={
@@ -113,31 +123,34 @@ function sceneInit.pause(org)
S.key.."/"..S.rotate.."/"..S.hold,
format("%d %.2fPPS",S.piece,S.piece/S.time),
format("%d(%d) %.2fLPM",S.row,S.dig,S.row/S.time*60),
format("%d(%d)",S.atk,S.digatk),
format("%d(%d) %.2fAPM",S.atk,S.digatk,S.atk/S.time*60),
format("%d(%d-%d)",S.pend,S.recv,S.recv-S.pend),
format("%d/%d/%d/%d",S.clear_S[1],S.clear_S[2],S.clear_S[3],S.clear_S[4]),
format("(%d)/%d/%d/%d",S.spin_S[1],S.spin_S[2],S.spin_S[3],S.spin_S[4]),
format("%d(+%d)/%d(%d)",S.b2b,S.b3b,S.pc,S.hpc),
format("%d/%d/%d/%d",S.clears[1],S.clears[2],S.clears[3],S.clears[4]),
format("(%d)/%d/%d/%d",S.spins[1],S.spins[2],S.spins[3],S.spins[4]),
format("%d/%d;%d/%d",S.b2b,S.b3b,S.pc,S.hpc),
format("%d[%.2f%%]",S.extraPiece,100*max(1-S.extraRate/S.piece,0)),
},
--from right-down, 60 degree each
radar={
(S.recv-S.pend+S.dig)/S.time*60,--DefPM
(S.recv-S.pend)/S.time*60, --OffPM
S.atk/S.time*60, --AtkPM
S.send/S.time*60, --SendPM
S.piece/S.time*24, --LinePM
S.dig/S.time*60, --DigPM
(S.off+S.dig)/S.time*60,--DefPM
(S.off)/S.time*60, --OffPM
S.atk/S.time*60, --AtkPM
S.send/S.time*60, --SendPM
S.piece/S.time*24, --LinePM
S.dig/S.time*60, --DigPM
},
val={1/80,1/40,1/60,1/60,1/100,1/40},
timing=org=="play",
}
local _=sceneTemp
local A,B=_.radar,_.val
--Normalize Values
for i=1,6 do
B[i]=B[i]*A[i]if B[i]>1.26 then B[i]=1.26+(B[i]-1.26)*.26 end
end--normalize vals
B[i]=B[i]*A[i]if B[i]>1.26 then B[i]=1.26+log(B[i]-.26,10)end
end
for i=1,6 do
A[i]=format("%.2f",A[i])..text.radarData[i]
end
@@ -184,7 +197,7 @@ function sceneInit.setting_control()
dir=1,
wait=30,
}
BG.set("strap")
BG.set("game1")
end
function sceneInit.setting_key()
sceneTemp={
@@ -194,7 +207,7 @@ function sceneInit.setting_key()
}
end
function sceneInit.setting_touch()
BG.set("game2")
BG.set("game3")
sceneTemp={
default=1,
snap=1,
@@ -205,13 +218,11 @@ function sceneInit.setting_touchSwitch()
BG.set("matrix")
end
function sceneInit.help()
sceneTemp={
pw=0,
}
BG.set("space")
end
function sceneInit.staff()
sceneTemp={
pw=0,
time=0,
v=1,
}
@@ -219,11 +230,21 @@ function sceneInit.staff()
end
function sceneInit.stat()
local S=stat
local X1,X2,Y1,Y2={0,0,0,0},{0,0,0,0},{},{}
for i=1,7 do
local S,C=S.spin[i],S.clear[i]
Y1[i]=S[1]+S[2]+S[3]+S[4]
Y2[i]=C[1]+C[2]+C[3]+C[4]
for j=1,4 do
X1[j]=X1[j]+S[j]
X2[j]=X2[j]+C[j]
end
end
sceneTemp={
chart={
A1=S.spin,A2=S.clear,
X1=S.spin_S,X2=S.clear_S,
Y1=S.spin_B,Y2=S.clear_B,
X1=X1,X2=X2,
Y1=Y1,Y2=Y2,
},
item={
S.run,
@@ -231,25 +252,34 @@ function sceneInit.stat()
toTime(S.time),
S.key.." "..S.rotate.." "..S.hold,
S.piece.." "..S.row.." "..int(S.atk),
S.recv.." "..(S.recv-S.pend).." "..S.pend,
S.recv.." "..S.off.." "..S.pend,
S.dig.." "..int(S.digatk),
format("%.2f %.2f",S.atk/S.row,S.digatk/S.dig),
format("%d/%.3f%%",S.extraPiece,100*max(1-S.extraRate/S.piece,0)),
S.b2b.." "..S.b3b,
S.pc.." "..S.hpc,
}
},
}
for i=1,11 do
sceneTemp.item[i]=text.stat[i].."\t"..sceneTemp.item[i]
end
end
function sceneInit.history()
BG.set("strap")
sceneTemp={require("updateLog"),1}--scroll pos
BG.set("game1")
sceneTemp={require("parts/updateLog"),1}--scroll pos
end
function sceneInit.debug()
sceneTemp={
ct=0,
}
end
function sceneInit.quit()
love.timer.sleep(.3)
love.event.quit()
if rnd()>.000626 then
love.timer.sleep(.3)
love.event.quit()
else
error("So lucky! 0.0626 precent to get this!!! You can quit the game now.")
end
end
@@ -259,17 +289,17 @@ local swap={
fade={30,15,function(t)
local t=t>15 and 2-t/15 or t/15
gc.setColor(0,0,0,t)
gc.rectangle("fill",0,0,scr.w,scr.h)
gc.rectangle("fill",0,0,scr.w*scr.dpi,scr.h*scr.dpi)
end},
fade_togame={120,20,function(t)
local t=t>20 and (120-t)/100 or t/20
gc.setColor(0,0,0,t)
gc.rectangle("fill",0,0,scr.w,scr.h)
gc.rectangle("fill",0,0,scr.w*scr.dpi,scr.h*scr.dpi)
end},
slowFade={180,90,function(t)
local t=t>90 and 2-t/90 or t/90
gc.setColor(0,0,0,t)
gc.rectangle("fill",0,0,scr.w,scr.h)
gc.rectangle("fill",0,0,scr.w*scr.dpi,scr.h*scr.dpi)
end},
}--Scene swapping animations
local backFunc={
@@ -292,7 +322,7 @@ function SCN.swapUpdate()
if S.time==S.mid then
SCN.init(S.tar,SCN.cur)
SCN.cur=S.tar
WIDGET.set(widgetList[S.tar])
WIDGET.set(Widgets[S.tar])
collectgarbage()
--Scene swapped this moment
end
@@ -327,6 +357,9 @@ function SCN.swapTo(tar,style)
S.draw=swap[3]
end
end
function SCN.goto(tar,style)
SCN.push()SCN.swapTo(tar,style)
end
function SCN.back()
if backFunc[SCN.cur] then backFunc[SCN.cur]()end
--func when scene end

View File

@@ -10,6 +10,7 @@ SFX.list={
"virtualKey",
"button","swipe",
"ready","start","win","fail","collect",
"spawn_1","spawn_2","spawn_3","spawn_4","spawn_5","spawn_6","spawn_7",
"move","rotate","rotatekick","hold",
"prerotate","prehold",
"lock","drop","fall",
@@ -35,9 +36,10 @@ end
function SFX.fieldPlay(s,v,P)
SFX.play(s,v,(P.curX+P.sc[2]-6.5)*.15)
end
function SFX.play(s,v,pos)
if setting.sfx==0 then return end
function SFX.play(s,vol,pos,force)
if setting.sfx==0 and not force then return end
local S=SFX.list[s]--source list
if not S then return end
local n=1
while S[n]:isPlaying()do
n=n+1
@@ -56,7 +58,11 @@ function SFX.play(s,v,pos)
S:setPosition(0,0,0)
end
end
S:setVolume((v or 1)*setting.sfx*.1)
if not force then
S:setVolume((vol or 1)*setting.sfx*.1)
else
S:setVolume(vol*.1)
end
S:play()
end
function SFX.reset()

14
Zframework/shader.lua Normal file
View File

@@ -0,0 +1,14 @@
local function N(file)
return love.graphics.newShader("Zframework/shader/"..file..".glsl")
end
return{
-- glow=gc.newShader("Zframework/shader/glow.cs"),
alpha=N("alpha"),
warning=N("warning"),
aura=N("aura"),
gradient1=N("grad1"),--Horizonal red-blue gradient
gradient2=N("grad2"),--Vertical red-green gradient
rgb1=N("rgb1"),--colorful RGB
rgb2=N("rgb2"),--blue RGB
}

View File

@@ -37,6 +37,6 @@ vec4 effect(vec4 color,Image text,vec2 pos,vec2 scr_pos){
dx=sqrt(dx*dx+dy*dy);
V.gb+=vec2(smoothstep(0.626,0.,dx));
dx=1.26*max(max(V.r,V.g),V.b);
dx=1.626*max(max(V.r,V.g),V.b);
return vec4(V/dx,1.);
}

View File

@@ -0,0 +1,10 @@
extern float t,w;
vec4 effect(vec4 color,Image text,vec2 pos,vec2 scr_pos){
float x=scr_pos.x/w;
return vec4(
.8-x*.6,
.3+.2*sin(t),
.15+x*.7,
1.
);
}

View File

@@ -0,0 +1,10 @@
extern float t,h;
vec4 effect(vec4 color,Image text,vec2 pos,vec2 scr_pos){
float y=scr_pos.y/h;
return vec4(
.8-y*.6,
.2+y*.4,
.3+.1*sin(t),
1.
);
}

View File

@@ -0,0 +1,11 @@
extern float t,w,h;
vec4 effect(vec4 color,Image text,vec2 pos,vec2 scr_pos){
float x=scr_pos.x/w;
float y=scr_pos.y/h;
return vec4(
.8-y*.7+.2*sin(t/6.26),
.2+y*.5+.15*sin(t/4.),
.2+x*.6-.1*sin(t/2.83),
1.
);
}

View File

@@ -0,0 +1,11 @@
extern float t,w,h;
vec4 effect(vec4 color,Image text,vec2 pos,vec2 scr_pos){
float x=scr_pos.x/w;
float y=scr_pos.y/h;
return vec4(
.4-y*.3-.1*sin(t/6.26),
.2+.1*sin(t),
abs(.7-x*1.2+y*.5*sin(t/16.)),
1.
);
}

View File

@@ -1,5 +1,4 @@
local rem=table.remove
local tasks={}
local TASK={}
@@ -9,17 +8,14 @@ end
function TASK.update()
for i=#tasks,1,-1 do
local T=tasks[i]
if T.code(T.P,T.data)then
for i=i,#tasks do
tasks[i]=tasks[i+1]
end
if T.code(T.data)then
rem(tasks,i)
end
end
end
function TASK.new(code,P,data)
function TASK.new(code,data)
tasks[#tasks+1]={
code=code,
P=P,
data=data,
}
end
@@ -51,12 +47,6 @@ function TASK.clear(opt)
tasks[i]=nil
i=i-1
end
elseif opt=="play"then
for i=#tasks,1,-1 do
if tasks[i].P then
rem(tasks,i)
end
end
else--Player table
for i=#tasks,1,-1 do
if tasks[i].P==opt then

View File

@@ -18,13 +18,13 @@ function Tmr.load()
elseif S.phase==4 then
IMG.loadOne(S.cur)
elseif S.phase==5 then
local m=modes[S.cur]
modes[S.cur]=require("modes/"..m[1])
local M=modes[S.cur]
M.saveFileName,M.id=m[1],m.id
M.x,M.y,M.size,M.shape=m.x,m.y,m.size,m.shape
M.unlock=m.unlock
M.records=FILE.loadRecord(m[1])or M.score and{}
local m=Modes[S.cur]--mode template
local M=require("modes/"..m.name)--mode file
Modes[m.name],Modes[S.cur]=M
for k,v in next,m do
M[k]=v
end
M.records=FILE.loadRecord(m.name)or M.score and{}
-- M.icon=gc.newImage("image/modeIcon/"..m.icon..".png")
-- M.icon=gc.newImage("image/modeIcon/custom.png")
elseif S.phase==6 then
@@ -55,31 +55,13 @@ function Tmr.load()
until not S.skip and Timer()-t>.01
end
function Tmr.intro()
sceneTemp=sceneTemp+1
if sceneTemp==200 then sceneTemp=80 end
local s=sceneTemp
s.t1=s.t1+1
s.t2=s.t2+1
end
function Tmr.main(dt)
players[1]:update(dt)
end
local function dumpTable(L)
local s="{\n"
for k,v in next,L do
local T
T=type(k)
if T=="number"then k="["..k.."]="
elseif T=="string"then k=k.."="
else assert(false,"Error data type!")
end
T=type(v)
if T=="number"then v=tostring(v)
elseif T=="string"then v="\""..v.."\""
elseif T=="table"then v=dumpTable(v)
else assert(false,"Error data type!")
end
s=s..k..v..",\n"
end
return s.."}"
end
function Tmr.mode(dt)
local cam=mapCam
local x,y,k=cam.x,cam.y,cam.k
@@ -105,21 +87,19 @@ function Tmr.mode(dt)
cam.keyCtrl=true
end
local x,y=(cam.x1-180)/cam.k1,cam.y1/cam.k1
local MM,R=modes,modeRanks
for _=1,#MM do
if R[_]then
local __
local M=MM[_]
for name,M in next,Modes do
if modeRanks[name]then
local SEL
local s=M.size
if M.shape==1 then
if x>M.x-s and x<M.x+s and y>M.y-s and y<M.y+s then __=_ end
if x>M.x-s and x<M.x+s and y>M.y-s and y<M.y+s then SEL=name end
elseif M.shape==2 then
if abs(x-M.x)+abs(y-M.y)<s then __=_ end
if abs(x-M.x)+abs(y-M.y)<s then SEL=name end
elseif M.shape==3 then
if(x-M.x)^2+(y-M.y)^2<s^2 then __=_ end
if(x-M.x)^2+(y-M.y)^2<s^2 then SEL=name end
end
if __ and cam.sel~=__ then
cam.sel=__
if SEL and cam.sel~=SEL then
cam.sel=SEL
SFX.play("click")
end
end
@@ -142,7 +122,7 @@ function Tmr.mode(dt)
cam.zoomMethod=_=="play"and 1 or _=="mode"and 2
if cam.zoomMethod==1 then
if cam.sel then
local M=modes[cam.sel]
local M=Modes[cam.sel]
cam.x=cam.x*.8+M.x*cam.k*.2
cam.y=cam.y*.8+M.y*cam.k*.2
end
@@ -154,11 +134,14 @@ function Tmr.mode(dt)
cam.zoomK=cam.zoomK^.9
end
end
function Tmr.sequence()
if sceneTemp.sure>0 then sceneTemp.sure=sceneTemp.sure-1 end
end
function Tmr.draw()
if sceneTemp.sure>0 then sceneTemp.sure=sceneTemp.sure-1 end
end
function Tmr.play(dt)
frame=frame+1
game.frame=game.frame+1
stat.time=stat.time+dt
local P1=players[1]
for i=#FX_attack,1,-1 do
@@ -199,10 +182,10 @@ function Tmr.play(dt)
end
end
if frame<180 then
if frame==179 then
if game.frame<180 then
if game.frame==179 then
gameStart()
elseif frame==60 or frame==120 then
elseif game.frame==60 or game.frame==120 then
SFX.play("ready")
end
for p=1,#players do
@@ -232,18 +215,15 @@ function Tmr.play(dt)
local P=players[p]
P:update(dt)
end
if frame%120==0 then
if game.frame%120==0 then
if modeEnv.royaleMode then freshMostDangerous()end
if marking and rnd()<.2 then
TEXT.show(text.marking,rnd(162,scr.w-162),rnd(126,scr.h-200),40,"mark",.626)
end--mark 2s each 10s
end
if P1.alive then
if frame%26==0 and setting.warn then
if game.frame%26==0 and setting.warn then
local F=P1.field
local M=#F
local height=0
for x=3,8 do
local height=0--max height of row 4~7
for x=4,7 do
for y=M,1,-1 do
if F[y][x]>0 then
if y>height then
@@ -319,5 +299,10 @@ function Tmr.staff(dt)
S.v=S.v-.26
end
S.time=S.time+S.v*dt
if S.time>45 then
S.time=45
elseif S.time<-10 then
S.time=-10
end
end
return Tmr

42
Zframework/toolfunc.lua Normal file
View File

@@ -0,0 +1,42 @@
local gc=love.graphics
local int=math.floor
local format=string.format
local fontData=love.filesystem.newFile("font.ttf")
local newFont=gc.setNewFont
local setNewFont=gc.setFont
local fontCache,currentFontSize={}
function setFont(s)
local f=fontCache[s]
if s~=currentFontSize then
if f then
setNewFont(f)
else
f=newFont(fontData,s)
fontCache[s]=f
setNewFont(f)
end
currentFontSize=s
end
return f
end
function toTime(s)
if s<60 then
return format("%.3fs",s)
elseif s<3600 then
return format("%d:%.2f",int(s/60),s%60)
else
local h=int(s/3600)
return format("%d:%d:%.2f",h,int(s/60%60),s%60)
end
end
function mStr(s,x,y)
gc.printf(s,x-450,y,900,"center")
end
function mText(s,x,y)
gc.draw(s,x-s:getWidth()*.5,y)
end
function mDraw(s,x,y,a,k)
gc.draw(s,x,y,a,k,nil,s:getWidth()*.5,s:getHeight()*.5)
end

View File

@@ -1,7 +1,7 @@
local level={0,0,.015,.02,.03,.04,.05,.06,.07,.08}
local _=love.system.vibrate
return function(t)
local L=setting.vib
local L=setting.vib
if L>0 then
_(level[L+t])
end

View File

@@ -1,8 +1,9 @@
local gc=love.graphics
local kb=love.keyboard
local int=math.floor
local int,abs=math.floor,math.abs
local format=string.format
local next=next
local color=color
local EMPTY={}
local button={
@@ -15,6 +16,9 @@ end
function button:isAbove(x,y)
return x>self.x-self.ATV and x<self.x+self.w+2*self.ATV and y>self.y-self.ATV and y<self.y+self.h+2*self.ATV
end
function button:getCenter()
return self.x+self.w*.5,self.y+self.h*.5
end
function button:FX()
sysFX.new("ripple",.16,self.x-self.ATV,self.y-self.ATV,self.w+2*self.ATV,self.h+2*self.ATV)
end
@@ -65,6 +69,9 @@ end
function switch:isAbove(x,y)
return x>self.x and x<self.x+50 and y>self.y-25 and y<self.y+25
end
function switch:getCenter()
return self.x,self.y
end
function switch:update()
local _=self.ATV
if WIDGET.sel==self then if _<8 then self.ATV=_+1 end
@@ -77,6 +84,8 @@ function switch:update()
end
function switch:draw()
local x,y=self.x,self.y-25
--Checked
if self.ATV>0 then
gc.setColor(1,1,1,self.ATV*.08)
gc.rectangle("fill",x,y,50,50)
@@ -86,11 +95,13 @@ function switch:draw()
gc.setLineWidth(6)
gc.line(x+5,y+25,x+18,y+38,x+45,y+11)
end
--checked
--Frame
gc.setLineWidth(4)
gc.setColor(1,1,1,.6+self.ATV*.05)
gc.rectangle("line",x,y,50,50)
--frame
--Text
local t=self.text
if t then
gc.setColor(1,1,1)
@@ -114,11 +125,15 @@ end
function slider:isAbove(x,y)
return x>self.x-10 and x<self.x+self.w+10 and y>self.y-20 and y<self.y+20
end
function slider:getCenter()
return self.x+self.w*(self.pos/self.unit),self.y
end
function slider:update()
local _=self.ATV
if WIDGET.sel==self then
if self.ATV<6 then self.ATV=self.ATV+1 end
if _<6 then self.ATV=_+1 end
else
if self.ATV>0 then self.ATV=self.ATV-1 end
if _>0 then self.ATV=_-1 end
end
if not(self.hide and self.hide())then
self.pos=self.pos*.7+self.disp()*.3
@@ -126,6 +141,8 @@ function slider:update()
end
function slider:draw()
local x,y=self.x,self.y
--Units
gc.setColor(1,1,1,.5+self.ATV*.06)
gc.setLineWidth(2)
local x1,x2=x,x+self.w
@@ -133,17 +150,20 @@ function slider:draw()
local x=x1+(x2-x1)*p/self.unit
gc.line(x,y+7,x,y-7)
end
--units
--Axis
gc.setLineWidth(4)
gc.line(x1,y,x2,y)
--axis
--Text
local t=self.text
if t then
gc.setColor(1,1,1)
setFont(self.font)
gc.printf(t,x-312,y-self.font*.7,300,"right")
end
--text
--Block
local x,y,w,h=x1+(x2-x1)*self.pos/self.unit-10-self.ATV*.5,y-16-self.ATV,20+self.ATV,32+2*self.ATV
gc.setColor(.8,.8,.8)
gc.rectangle("fill",x,y,w,h)
@@ -152,7 +172,6 @@ function slider:draw()
gc.setColor(1,1,1,self.ATV*.16)
gc.rectangle("line",x+1,y+1,w-2,h-2)
end
--block
end
function slider:getInfo()
print(format("x=%d,y=%d,w=%d",self.x,self.y,self.w))
@@ -172,36 +191,96 @@ function WIDGET.set(L)
end
WIDGET.new={}
function WIDGET.new.button(x,y,w,h,color,font,code,hide,N)
function WIDGET.newText(D)
local _={
x=x-w*.5,y=y-h*.5,
w=w,h=h,
color=color,
font=font,
code=code,
hide=hide,
next=N,
name= D.name,
x= D.x,
y= D.y,
align= D.align,
color= color[D.color]or D.color,
font= D.font,
hide= D.hide,
}for k,v in next,button do _[k]=v end return _
end
function WIDGET.new.switch(x,y,font,disp,code,hide,N)
function WIDGET.newImage(D)
local _={
x=x,y=y,font=font,
disp=disp,
code=code,
hide=hide,
next=N,
name= D.name,
x= D.x-w*.5,
y= D.y-h*.5,
w= D.w,
h= D.h,
color= color[D.color]or D.color,
font= D.font,
code= D.code,
hide= D.hide,
}for k,v in next,button do _[k]=v end return _
end
function WIDGET.newButton(D)
local _={
name= D.name,
x= D.x-D.w*.5,
y= D.y-D.h*.5,
w= D.w,
h= D.h,
resCtr={
D.x,D.y,
D.x-D.w*.35,D.y-D.h*.35,
D.x-D.w*.35,D.y+D.h*.35,
D.x+D.w*.35,D.y-D.h*.35,
D.x+D.w*.35,D.y+D.h*.35,
},
color= color[D.color]or D.color,
font= D.font,
code= D.code,
hide= D.hide,
}for k,v in next,button do _[k]=v end return _
end
function WIDGET.newSwitch(D)
local _={
name= D.name,
x= D.x,
y= D.y,
cx= D.x+25,
cy= D.y,
resCtr={
D.x+25,D.y,
},
font= D.font,
disp= D.disp,
code= D.code,
hide= D.hide,
}for k,v in next,switch do _[k]=v end return _
end
function WIDGET.new.slider(x,y,w,unit,font,change,disp,code,hide,N)
function WIDGET.newSlider(D)
local _={
x=x,y=y,
w=w,unit=unit,
font=font,
change=change,
disp=disp,
code=code,
hide=hide,
next=N,
name= D.name,
x= D.x,
y= D.y,
w= D.w,
cx= D.x+D.w*.5,
cy= D.y,
resCtr={
D.x,D.y,
D.x+D.w*.25,D.y,
D.x+D.w*.5,D.y,
D.x+D.w*.75,D.y,
D.x+D.w,D.y,
},
unit= D.unit,
font= D.font,
change= D.change,
disp= D.disp,
code= D.code,
hide= D.hide,
}for k,v in next,slider do _[k]=v end return _
end
@@ -247,44 +326,95 @@ function WIDGET.drag(x,y,dx,dy)
end
end
function WIDGET.keyPressed(i)
if i=="tab"then
if i=="space"or i=="return"then
if WIDGET.sel then
WIDGET.sel=kb.isDown("lshift")and WIDGET.sel.prev or WIDGET.sel.next or WIDGET.sel
else
WIDGET.sel=select(2,next(WIDGET.active))
WIDGET.press()
end
elseif i=="space"or i=="return"then
if WIDGET.sel then
WIDGET.press(WIDGET.sel)
end
elseif i=="left"or i=="right"then
local W=WIDGET.sel
if W then
if W.type=="slider"then
local p=W.disp()
local P=i=="left"and(p>0 and p-1)or p<W.unit and p+1
if p==P or not P then return end
W.code(P)
if W.change then W.change()end
elseif kb.isDown("lshift","lalt","lctrl")then
--when hold [↑], control slider with left/right
if i=="left"or i=="right"then
local W=WIDGET.sel
if W then
if W.type=="slider"then
local p=W.disp()
local P=i=="left"and(p>0 and p-1)or p<W.unit and p+1
if p==P or not P then return end
W.code(P)
if W.change then W.change()end
end
end
end
elseif i=="up"or i=="down"or i=="left"or i=="right"then
if WIDGET.sel then
local W=WIDGET.sel
local WX,WY=W:getCenter()
local dir=(i=="right"or i=="down")and 1 or -1
local tar
local minDist=1e99
if i=="left"or i=="right"then
for i=1,#WIDGET.active do
local W1=WIDGET.active[i]
if W~=W1 then
local L=W1.resCtr
for j=1,#L,2 do
local x,y=L[j],L[j+1]
local dist=(x-WX)*dir
if dist>10 then
dist=dist+abs(y-WY)*6.26
if dist<minDist then
minDist=dist
tar=W1
end
end
end
end
end
else
for i=1,#WIDGET.active do
local W1=WIDGET.active[i]
if W~=W1 then
local L=W1.resCtr
for j=1,#L,2 do
local x,y=L[j],L[j+1]
local dist=(y-WY)*dir
if dist>10 then
dist=dist+abs(x-WX)*6.26
if dist<minDist then
minDist=dist
tar=W1
end
end
end
end
end
end
if tar then
WIDGET.sel=tar
end
else
WIDGET.sel=WIDGET.active[1]
end
end
end
local keyMirror={
dpup="up",
dpdown="down",
dpleft="left",
dpright="right",
start="return",
back="escape",
}
function WIDGET.gamepadPressed(i)
if i=="dpup"or i=="dpdown"then
if i=="start"then
if WIDGET.sel then
WIDGET.sel=i=="dpup"and WIDGET.sel.prev or WIDGET.sel.next or WIDGET.sel
else
WIDGET.sel=select(2,next(WIDGET.active))
WIDGET.press()
end
elseif i=="start"then
if WIDGET.sel then
WIDGET.press(WIDGET.sel)
end
elseif i=="dpleft"or i=="dpright"then
if WIDGET.sel then
local W=WIDGET.sel
if W.type=="slider"then
elseif i=="a"or i=="b"then
local W=WIDGET.sel
if W then
if W.type=="button"then
WIDGET.press()
elseif W.type=="slider"then
local p=W.disp()
local P=i=="left"and(p>0 and p-1)or p<W.unit and p+1
if p==P or not P then return end
@@ -292,11 +422,15 @@ function WIDGET.gamepadPressed(i)
if W.change then W.change()end
end
end
elseif i=="dpup"or i=="dpdown"or i=="dpleft"or i=="dpright"then
WIDGET.keyPressed(keyMirror[i])
end
end
function WIDGET.update()
for _,W in next,WIDGET.active do W:update()end
for _,W in next,WIDGET.active do
W:update()
end
end
function WIDGET.draw()
for _,W in next,WIDGET.active do

513
Zframework/widgetList.lua Normal file
View File

@@ -0,0 +1,513 @@
local ins,rem=table.insert,table.remove
local mobileHide=(system=="Android"or system=="iOS")and function()return true end
local function BACK()SCN.back()end
local virtualkeySet={
{
{1, 80, 720-200, 80},--moveLeft
{2, 320, 720-200, 80},--moveRight
{3, 1280-80, 720-200, 80},--rotRight
{4, 1280-200, 720-80, 80},--rotLeft
{5, 1280-200, 720-320, 80},--rot180
{6, 200, 720-320, 80},--hardDrop
{7, 200, 720-80, 80},--softDrop
{8, 1280-320, 720-200, 80},--hold
{9, 1280-80, 280, 80},--func
{10,80, 280, 80},--restart
},--Farter's set,thanks
{
{1, 1280-320, 720-200, 80},--moveLeft
{2, 1280-80, 720-200, 80},--moveRight
{3, 200, 720-80, 80},--rotRight
{4, 80, 720-200, 80},--rotLeft
{5, 200, 720-320, 80},--rot180
{6, 1280-200, 720-320, 80},--hardDrop
{7, 1280-200, 720-80, 80},--softDrop
{8, 320, 720-200, 80},--hold
{9, 80, 280, 80},--func
{10,1280-80, 280, 80},--restart
},--Mirrored farter's set,sknaht
{
{1, 80, 720-80, 80},--moveLeft
{2, 240, 720-80, 80},--moveRight
{3, 1280-240, 720-80, 80},--rotRight
{4, 1280-400, 720-80, 80},--rotLeft
{5, 1280-240, 720-240, 80},--rot180
{6, 1280-80, 720-80, 80},--hardDrop
{7, 1280-80, 720-240, 80},--softDrop
{8, 1280-80, 720-400, 80},--hold
{9, 80, 360, 80},--func
{10,80, 80, 80},--restart
},--Author's set,not recommend
{
{1, 1280-400, 720-80, 80},--moveLeft
{2, 1280-80, 720-80, 80},--moveRight
{3, 240, 720-80, 80},--rotRight
{4, 80, 720-80, 80},--rotLeft
{5, 240, 720-240, 80},--rot180
{6, 1280-240, 720-240, 80},--hardDrop
{7, 1280-240, 720-80, 80},--softDrop
{8, 1280-80, 720-240, 80},--hold
{9, 80, 720-240, 80},--func
{10,80, 320, 80},--restart
},--Keyboard set
{
{10,70, 50,30},--restart
{9, 130, 50,30},--func
{4, 190, 50,30},--rotLeft
{3, 250, 50,30},--rotRight
{5, 310, 50,30},--rot180
{1, 370, 50,30},--moveLeft
{2, 430, 50,30},--moveRight
{8, 490, 50,30},--hold
{7, 550, 50,30},--softDrop1
{6, 610, 50,30},--hardDrop
{11,670, 50,30},--insLeft
{12,730, 50,30},--insRight
{13,790, 50,30},--insDown
{14,850, 50,30},--down1
{15,910, 50,30},--down4
{16,970, 50,30},--down10
{17,1030, 50,30},--dropLeft
{18,1090, 50,30},--dropRight
{19,1150, 50,30},--addLeft
{20,1210, 50,30},--addRight
},--PC key feedback(top&in a row)
}
--Lambda Funcs for widgets,delete at file end
local function SETval(k) return function()return setting[k] end end
local function SETsto(k) return function(i)setting[k]=i end end
local function SETrev(k) return function()setting[k]=not setting[k] end end
local function pressKey(k) return function()love.keypressed(k) end end
local function setPen(i) return function()sceneTemp.pen=i end end
local function prevSkin(n) return function()SKIN.prev(n) end end
local function nextSkin(n) return function()SKIN.next(n) end end
local function nextDir(n) return function()SKIN.rotate(n) end end
local function VKAdisp(n) return function()return VK_org[n].ava end end
local function VKAcode(n) return function()VK_org[n].ava=not VK_org[n].ava end end
local function setLang(n) return function()LANG.set(n)setting.lang=n end end
--newXXX
newText=WIDGET.newText
newImage=WIDGET.newImage
newButton=WIDGET.newButton
newSwitch=WIDGET.newSwitch
newSlider=WIDGET.newSlider
--All widgets
local Widgets={
load={},intro={},quit={},
main={
newButton({name="play", x=150,y=280,w=200,h=160,color="lRed", font=55,code=function()SCN.goto("mode")end}),
newButton({name="setting", x=370,y=280,w=200,h=160,color="lBlue", font=45,code=function()SCN.goto("setting_game")end}),
newButton({name="music", x=590,y=280,w=200,h=160,color="lPurple",font=32,code=function()SCN.goto("music")end}),
newButton({name="help", x=150,y=460,w=200,h=160,color="lYellow",font=50,code=function()SCN.goto("help")end}),
newButton({name="stat", x=370,y=460,w=200,h=160,color="lCyan", font=43,code=function()SCN.goto("stat")end}),
newButton({name="qplay", x=590,y=460,w=200,h=160,color="lOrange",font=43,code=function()SCN.push()loadGame(stat.lastPlay)end}),
newButton({name="lang", x=150,y=610,w=160,h=100,color="lGreen", font=45,code=function()SCN.goto("setting_lang")end}),
newButton({name="quit", x=590,y=610,w=160,h=100,color="lGrey", font=45,code=function()VOC.play("bye")SCN.swapTo("quit","slowFade")end}),
},
mode={
newButton({name="setting",x=1100,y=540,w=240,h=90,color="lGreen", font=40,code=function()
SCN.goto("custom")
end,
hide=function()
return mapCam.sel~="custom_clear" and mapCam.sel~="custom_puzzle"
end}),
newButton({name="start", x=1040,y=655,w=180,h=80,color="lGrey", font=40,code=pressKey("return"),hide=function()return not mapCam.sel end}),
newButton({name="back", x=1200,y=655,w=120,h=80,color="white", font=40,code=BACK}),
},
music={
newSlider({name="bgm", x=760, y=80, w=400,unit=10, font=35,change=function()BGM.freshVolume()end,disp=SETval("bgm"),code=SETsto("bgm")}),
newButton({name="up", x=1100, y=200, w=120,h=120, color="white", font=55,code=pressKey("up")}),
newButton({name="play", x=1100, y=340, w=120,h=120, color="white", font=35,code=pressKey("space"),hide=function()return setting.bgm==0 end}),
newButton({name="down", x=1100, y=480, w=120,h=120, color="white", font=55,code=pressKey("down")}),
newButton({name="back", x=640, y=630, w=230,h=90, color="white", font=40,code=BACK}),
},
custom={
newButton({name="up", x=1140, y=100, w=100,h=100, color="white", font=45,code=function()sceneTemp=(sceneTemp-2)%#customID+1 end}),
newButton({name="down", x=1140, y=340, w=100,h=100, color="white", font=45,code=function()sceneTemp=sceneTemp%#customID+1 end}),
newButton({name="left", x=1080, y=220, w=100,h=100, color="white", font=45,code=pressKey("left")}),
newButton({name="right", x=1200, y=220, w=100,h=100, color="white", font=45,code=pressKey("right")}),
newButton({name="set1", x=940, y=320, w=260,h=70, color="lYellow",font=32,code=pressKey("1")}),
newButton({name="set2", x=940, y=400, w=260,h=70, color="lYellow",font=32,code=pressKey("2")}),
newButton({name="set3", x=940, y=480, w=260,h=70, color="lYellow",font=32,code=pressKey("3")}),
newButton({name="set4", x=940, y=560, w=260,h=70, color="lYellow",font=32,code=pressKey("4")}),
newButton({name="set5", x=940, y=640, w=260,h=70, color="lYellow",font=32,code=pressKey("5")}),
newButton({name="seq", x=665, y=415, w=200,h=40, color="lGreen", font=30,code=pressKey("q")}),
newButton({name="draw", x=150, y=80, w=220,h=80, color="white", font=35,code=pressKey("e")}),
newButton({name="back", x=1200, y=640, w=120,h=120, color="white", font=35,code=BACK}),
},
sequence={
newButton({name="Z", x=150, y=440, w=90,h=90, color="white", font=50,code=pressKey(1)}),
newButton({name="S", x=250, y=440, w=90,h=90, color="white", font=50,code=pressKey(2)}),
newButton({name="J", x=350, y=440, w=90,h=90, color="white", font=50,code=pressKey(3)}),
newButton({name="L", x=450, y=440, w=90,h=90, color="white", font=50,code=pressKey(4)}),
newButton({name="T", x=550, y=440, w=90,h=90, color="white", font=50,code=pressKey(5)}),
newButton({name="O", x=650, y=440, w=90,h=90, color="white", font=50,code=pressKey(6)}),
newButton({name="I", x=750, y=440, w=90,h=90, color="white", font=50,code=pressKey(7)}),
newButton({name="Z5", x=150, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(8)}),
newButton({name="S5", x=250, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(9)}),
newButton({name="P", x=350, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(10)}),
newButton({name="Q", x=450, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(11)}),
newButton({name="F", x=550, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(12)}),
newButton({name="E", x=650, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(13)}),
newButton({name="T5", x=750, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(14)}),
newButton({name="U", x=850, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(15)}),
newButton({name="V", x=950, y=540, w=90,h=90, color="dGrey",font=50,code=pressKey(16)}),
newButton({name="W", x=150, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(17)}),
newButton({name="X", x=250, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(18)}),
newButton({name="J5", x=350, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(19)}),
newButton({name="L5", x=450, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(20)}),
newButton({name="R", x=550, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(21)}),
newButton({name="Y", x=650, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(22)}),
newButton({name="N", x=750, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(23)}),
newButton({name="H", x=850, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(24)}),
newButton({name="I5", x=950, y=640, w=90,h=90, color="dGrey",font=50,code=pressKey(25)}),
newButton({name="left", x=850, y=440, w=90,h=90, color="lGreen", font=55,code=pressKey("left")}),
newButton({name="right", x=950, y=440, w=90,h=90, color="lGreen", font=55,code=pressKey("right")}),
newButton({name="backsp", x=1050, y=440, w=90,h=90, color="lRed", font=50,code=pressKey("backspace")}),
newButton({name="reset", x=1050, y=540, w=90,h=90, color="lRed", font=50,code=pressKey("delete")}),
newButton({name="back", x=1200, y=640, w=120,h=120, color="white", font=35,code=BACK}),
},
draw={
newButton({name="b1", x=500+65*1, y=150,w=58,h=58, color="red", font=30,code=setPen(1)}),--B1
newButton({name="b2", x=500+65*2, y=150,w=58,h=58, color="orange", font=30,code=setPen(2)}),--B2
newButton({name="b3", x=500+65*3, y=150,w=58,h=58, color="yellow", font=30,code=setPen(3)}),--B3
newButton({name="b4", x=500+65*4, y=150,w=58,h=58, color="grass", font=30,code=setPen(4)}),--B4
newButton({name="b5", x=500+65*5, y=150,w=58,h=58, color="green", font=30,code=setPen(5)}),--B5
newButton({name="b6", x=500+65*6, y=150,w=58,h=58, color="water", font=30,code=setPen(6)}),--B6
newButton({name="b7", x=500+65*7, y=150,w=58,h=58, color="cyan", font=30,code=setPen(7)}),--B7
newButton({name="b8", x=500+65*8, y=150,w=58,h=58, color="blue", font=30,code=setPen(8)}),--B8
newButton({name="b9", x=500+65*9, y=150,w=58,h=58, color="purple", font=30,code=setPen(9)}),--B9
newButton({name="b10", x=500+65*10,y=150,w=58,h=58, color="magenta",font=30,code=setPen(10)}),--B10
newButton({name="b11", x=500+65*11,y=150,w=58,h=58, color="pink", font=30,code=setPen(11)}),--B11
newButton({name="b12", x=500+65*1, y=230,w=58,h=58, color="dGrey", font=30,code=setPen(12)}),--Bone
newButton({name="b13", x=500+65*2, y=230,w=58,h=58, color="grey", font=30,code=setPen(13)}),--GB1
newButton({name="b14", x=500+65*3, y=230,w=58,h=58, color="lGrey", font=30,code=setPen(14)}),--GB2
newButton({name="b15", x=500+65*4, y=230,w=58,h=58, color="dPurple",font=30,code=setPen(15)}),--GB3
newButton({name="b16", x=500+65*5, y=230,w=58,h=58, color="dRed", font=30,code=setPen(16)}),--GB4
newButton({name="b17", x=500+65*6, y=230,w=58,h=58, color="dGreen", font=30,code=setPen(17)}),--GB5
newButton({name="any", x=600, y=360, w=120,h=120, color="lGrey", font=40,code=setPen(0)}),
newButton({name="space", x=730, y=360, w=120,h=120, color="grey", font=65,code=setPen(-1)}),
newButton({name="clear", x=1200, y=500, w=120,h=120, color="white", font=40,code=pressKey("delete")}),
newSwitch({name="demo", x=755, y=640, font=30,disp=function()return sceneTemp.demo end,code=function()sceneTemp.demo=not sceneTemp.demo end}),
newButton({name="copy", x=920, y=640, w=120,h=120, color="lRed", font=35,code=function()copyBoard()end}),
newButton({name="paste", x=1060, y=640, w=120,h=120, color="lBlue", font=35,code=function()pasteBoard()end}),
newButton({name="custom", x=110, y=80, w=140,h=80, color="white", font=35,code=function()SCN.goto("custom")end}),
newButton({name="back", x=1200, y=640, w=120,h=120, color="white", font=35,code=BACK}),
},
play={
newButton({name="pause", x=1235, y=45, w=80,h=80, color="white", font=25,code=function()pauseGame()end}),
},
pause={
newButton({name="resume", x=640,y=290,w=240,h=100,color="white",font=30,code=function()resumeGame()end}),
newButton({name="restart", x=640,y=445,w=240,h=100,color="white",font=33,
code=function()
TASK.removeTask_code(TICK.autoPause)
mergeStat(stat,players[1].stat)
resetGameData()
SCN.swapTo("play","none")
end}),
newButton({name="setting", x=1120, y=70, w=240,h=90, color="lBlue",font=35,
code=function()
SCN.goto("setting_sound")
end}),
newButton({name="quit", x=640, y=600, w=240,h=100,color="white",font=35,code=BACK}),
},
setting_game={
newButton({name="graphic", x=200, y=80, w=240,h=80, color="lCyan", font=35,code=function()SCN.swapTo("setting_video")end}),
newButton({name="sound", x=1080, y=80, w=240,h=80, color="lCyan", font=35,code=function()SCN.swapTo("setting_sound")end}),
newButton({name="ctrl", x=290, y=220, w=320,h=80, color="lYellow",font=35,code=function()SCN.goto("setting_control")end}),
newButton({name="key", x=640, y=220, w=320,h=80, color="lGreen", font=35,code=function()SCN.goto("setting_key")end}),
newButton({name="touch", x=990, y=220, w=320,h=80, color="lBlue", font=35,code=function()SCN.goto("setting_touch")end}),
newSlider({name="reTime", x=350, y=340, w=300,unit=10, font=30,disp=SETval("reTime"), code=SETsto("reTime")}),
newSlider({name="maxNext", x=350, y=440, w=300,unit=6, font=30,disp=SETval("maxNext"), code=SETsto("maxNext")}),
newSwitch({name="autoPause",x=350, y=540, font=20,disp=SETval("autoPause"),code=SETrev("autoPause")}),
newButton({name="layout", x=590, y=540, w=140,h=70,color="white", font=35,code=function()
SCN.goto("setting_skin")
end}),
newSwitch({name="quickR", x=1050,y=320,font=35, disp=SETval("quickR"), code=SETrev("quickR")}),
newSwitch({name="swap", x=1050,y=400,font=20, disp=SETval("swap"), code=SETrev("swap")}),
newSwitch({name="fine", x=1050,y=480,font=20, disp=SETval("fine"), code=SETrev("fine")}),
newButton({name="back", x=1140,y=650,w=200,h=80,color="white",font=40,code=BACK}),
},
setting_video={
newButton({name="sound", x=200, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_sound")end}),
newButton({name="game", x=1080, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_game")end}),
newSwitch({name="ghost", x=250, y=180,font=35, disp=SETval("ghost"), code=SETrev("ghost")}),
newSwitch({name="smooth", x=250, y=260,font=25, disp=SETval("smooth"), code=SETrev("smooth")}),
newSwitch({name="center", x=500, y=180,font=35, disp=SETval("center"), code=SETrev("center")}),
newSwitch({name="grid", x=500, y=260,font=30, disp=SETval("grid"), code=SETrev("grid")}),
newSwitch({name="bagLine", x=730, y=180,font=30, disp=SETval("bagLine"), code=SETrev("bagLine")}),
newSlider({name="lockFX", x=350, y=340,w=373,unit=3, font=32,disp=SETval("lockFX"), code=SETsto("lockFX")}),
newSlider({name="dropFX", x=350, y=400,w=373,unit=5, font=32,disp=SETval("dropFX"), code=SETsto("dropFX")}),
newSlider({name="clearFX", x=350, y=460,w=373,unit=3, font=32,disp=SETval("clearFX"), code=SETsto("clearFX")}),
newSlider({name="shakeFX", x=350, y=520,w=373,unit=5, font=32,disp=SETval("shakeFX"), code=SETsto("shakeFX")}),
newSlider({name="atkFX", x=350, y=580,w=373,unit=5, font=32,disp=SETval("atkFX"), code=SETsto("atkFX")}),
newSlider({name="frame", x=350, y=640,w=373,unit=10,font=30,
disp=function()
return setting.frameMul>35 and setting.frameMul/10 or setting.frameMul/5-4
end,
code=function(i)
setting.frameMul=i<5 and 5*i+20 or 10*i
end}),
newSwitch({name="text", x=1050, y=180, font=35,disp=SETval("text"),code=SETrev("text")}),
newSwitch({name="warn", x=1050, y=260, font=35,disp=SETval("warn"),code=SETrev("warn")}),
newSwitch({name="fullscreen",x=1050,y=340, font=35,disp=SETval("fullscreen"),
code=function()
setting.fullscreen=not setting.fullscreen
love.window.setFullscreen(setting.fullscreen)
love.resize(love.graphics.getWidth(),love.graphics.getHeight())
end}),
newSwitch({name="bg", x=1050, y=420, font=35,disp=SETval("bg"),
code=function()
BG.set("none")
setting.bg=not setting.bg
BG.set("space")
end}),
newSwitch({name="power", x=1050, y=500,font=35,disp=SETval("powerInfo"),
code=function()
setting.powerInfo=not setting.powerInfo
end}),
newButton({name="back", x=1140, y=650,w=200,h=80,color="white",font=40,code=BACK}),
},
setting_sound={
newButton({name="game", x=200, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_game")end}),
newButton({name="graphic", x=1080, y=80,w=240,h=80,color="lCyan",font=35,code=function()SCN.swapTo("setting_video")end}),
newSlider({name="sfx", x=180, y=200,w=400,unit=10,font=35,change=function()SFX.play("blip_1")end, disp=SETval("sfx"), code=SETsto("sfx")}),
newSlider({name="stereo", x=180, y=500,w=400,unit=10,font=35,change=function()SFX.play("move",1,-1)SFX.play("lock",1,1)end, disp=SETval("stereo"), code=SETsto("stereo"),hide=function()return setting.sfx==0 end}),
newSlider({name="spawn", x=180, y=300,w=400,unit=10,font=30,change=function()SFX.play("spawn_1",setting.spawn,nil,true)end, disp=SETval("spawn"), code=SETsto("spawn")}),
newSlider({name="bgm", x=180, y=400,w=400,unit=10,font=35,change=function()BGM.freshVolume()end, disp=SETval("bgm"), code=SETsto("bgm")}),
newSlider({name="vib", x=750, y=200,w=400,unit=5, font=28,change=function()VIB(2)end, disp=SETval("vib"), code=SETsto("vib")}),
newSlider({name="voc", x=750, y=300,w=400,unit=10,font=32,change=function()VOC.play("nya")end, disp=SETval("voc"), code=SETsto("voc")}),
newButton({name="back", x=1140, y=650,w=200,h=80,color="white",font=40,code=BACK}),
},
setting_control={
newSlider({name="das", x=226, y=200,w=910, unit=26, font=30,disp=SETval("das"), code=SETsto("das")}),
newSlider({name="arr", x=226, y=290,w=525, unit=15, font=30,disp=SETval("arr"), code=SETsto("arr")}),
newSlider({name="sddas", x=226, y=380,w=350, unit=10, font=30,disp=SETval("sddas"), code=SETsto("sddas")}),
newSlider({name="sdarr", x=226, y=470,w=140, unit=4, font=30,disp=SETval("sdarr"), code=SETsto("sdarr")}),
newSwitch({name="ihs", x=1100, y=290,font=30, disp=SETval("ihs"), code=SETrev("ihs")}),
newSwitch({name="irs", x=1100, y=380,font=30, disp=SETval("irs"), code=SETrev("irs")}),
newSwitch({name="ims", x=1100, y=470,font=30, disp=SETval("ims"), code=SETrev("ims")}),
newButton({name="reset", x=160, y=580,w=200,h=100,color="lRed",font=40,
code=function()
local _=setting
_.das,_.arr=10,2
_.sddas,_.sdarr=0,2
_.ihs,_.irs,_.ims=false,false,false
end}),
newButton({name="back", x=1140,y=650,w=200,h=80,color="white",font=40,code=BACK}),
},
setting_key={
newButton({name="back", x=1140,y=650,w=200,h=80,color="white",font=45,code=BACK}),
},
setting_skin={
newButton({name="prev", x=700,y=100,w=140,h=100,color="white",font=50,code=function()SKIN.prevSet()end}),
newButton({name="next", x=860,y=100,w=140,h=100,color="white",font=50,code=function()SKIN.nextSet()end}),
newButton({name="prev1", x=130,y=230,w=90,h=65,color="white",font=30,code=prevSkin(1)}),
newButton({name="prev2", x=270,y=230,w=90,h=65,color="white",font=30,code=prevSkin(2)}),
newButton({name="prev3", x=410,y=230,w=90,h=65,color="white",font=30,code=prevSkin(3)}),
newButton({name="prev4", x=550,y=230,w=90,h=65,color="white",font=30,code=prevSkin(4)}),
newButton({name="prev5", x=690,y=230,w=90,h=65,color="white",font=30,code=prevSkin(5)}),
newButton({name="prev6", x=830,y=230,w=90,h=65,color="white",font=30,code=prevSkin(6)}),
newButton({name="prev7", x=970,y=230,w=90,h=65,color="white",font=30,code=prevSkin(7)}),
newButton({name="next1", x=130,y=450,w=90,h=65,color="white",font=30,code=nextSkin(1)}),
newButton({name="next2", x=270,y=450,w=90,h=65,color="white",font=30,code=nextSkin(2)}),
newButton({name="next3", x=410,y=450,w=90,h=65,color="white",font=30,code=nextSkin(3)}),
newButton({name="next4", x=550,y=450,w=90,h=65,color="white",font=30,code=nextSkin(4)}),
newButton({name="next5", x=690,y=450,w=90,h=65,color="white",font=30,code=nextSkin(5)}),
newButton({name="next6", x=830,y=450,w=90,h=65,color="white",font=30,code=nextSkin(6)}),
newButton({name="next7", x=970,y=450,w=90,h=65,color="white",font=30,code=nextSkin(7)}),
newButton({name="spin1", x=130,y=540,w=90,h=65,color="white",font=30,code=nextDir(1)}),
newButton({name="spin2", x=270,y=540,w=90,h=65,color="white",font=30,code=nextDir(2)}),
newButton({name="spin3", x=410,y=540,w=90,h=65,color="white",font=30,code=nextDir(3)}),
newButton({name="spin4", x=550,y=540,w=90,h=65,color="white",font=30,code=nextDir(4)}),
newButton({name="spin5", x=690,y=540,w=90,h=65,color="white",font=30,code=nextDir(5)}),
--newButton({name="spin6",x=825,y=540,w=90,h=65,color="white",font=30,code=nextDir(6)}),--cannot rotate O
newButton({name="spin7", x=970,y=540,w=90,h=65,color="white",font=30,code=nextDir(7)}),
newButton({name="skinR", x=200,y=640,w=220,h=80,color="lPurple",font=35,
code=function()
setting.skin={1,5,8,2,10,3,7,1,5,5,1,8,2,10,3,7,10,7,8,2,8,2,1,5,3}
SFX.play("rotate")
end}),
newButton({name="faceR", x=480,y=640,w=220,h=80,color="lRed",font=35,
code=function()
for i=1,25 do
setting.face[i]=0
end
SFX.play("hold")
end}),
newButton({name="back", x=1140,y=650,w=200,h=80,color="white",font=40,code=BACK}),
},
setting_touch={
newButton({name="default", x=520,y=80,w=170,h=80,color="white",font=35,
code=function()
local D=virtualkeySet[sceneTemp.default]
for i=1,#VK_org do
VK_org[i].ava=false
end
for n=1,#D do
local T=D[n]
if T[1]then
local B=VK_org[n]
B.ava=true
B.x,B.y,B.r=T[2],T[3],T[4]
end
end--Replace keys
sceneTemp.default=sceneTemp.default%5+1
sceneTemp.sel=nil
end}),
newButton({name="snap", x=760,y=80,w=170,h=80,color="white",font=35,
code=function()
sceneTemp.snap=sceneTemp.snap%6+1
end}),
newButton({name="option", x=520,y=180,w=170,h=80,color="white",font=40,
code=function()
SCN.goto("setting_touchSwitch")
end}),
newButton({name="back", x=760,y=180,w=170,h=80,color="white",font=40,code=BACK}),
newSlider({name="size", x=450,y=265,w=460,unit=14,font=40,
disp=function()
return VK_org[sceneTemp.sel].r/10-1
end,
code=function(v)
if sceneTemp.sel then
VK_org[sceneTemp.sel].r=10+v*10
end
end,
hide=function()
return not sceneTemp.sel
end}),
},
setting_touchSwitch={
newSwitch({name="b1", x=280, y=80, font=35,disp=VKAdisp(1),code=VKAcode(1)}),
newSwitch({name="b2", x=280, y=140, font=35,disp=VKAdisp(2),code=VKAcode(2)}),
newSwitch({name="b3", x=280, y=200, font=35,disp=VKAdisp(3),code=VKAcode(3)}),
newSwitch({name="b4", x=280, y=260, font=35,disp=VKAdisp(4),code=VKAcode(4)}),
newSwitch({name="b5", x=280, y=320, font=35,disp=VKAdisp(5),code=VKAcode(5)}),
newSwitch({name="b6", x=280, y=380, font=35,disp=VKAdisp(6),code=VKAcode(6)}),
newSwitch({name="b7", x=280, y=440, font=35,disp=VKAdisp(7),code=VKAcode(7)}),
newSwitch({name="b8", x=280, y=500, font=35,disp=VKAdisp(8),code=VKAcode(8)}),
newSwitch({name="b9", x=280, y=560, font=35,disp=VKAdisp(9),code=VKAcode(9)}),
newSwitch({name="b10", x=280, y=620, font=35,disp=VKAdisp(10),code=VKAcode(10)}),
newSwitch({name="b11", x=620, y=80, font=35,disp=VKAdisp(11),code=VKAcode(11)}),
newSwitch({name="b12", x=620, y=140, font=35,disp=VKAdisp(12),code=VKAcode(12)}),
newSwitch({name="b13", x=620, y=200, font=35,disp=VKAdisp(13),code=VKAcode(13)}),
newSwitch({name="b14", x=620, y=260, font=35,disp=VKAdisp(14),code=VKAcode(14)}),
newSwitch({name="b15", x=620, y=320, font=35,disp=VKAdisp(15),code=VKAcode(15)}),
newSwitch({name="b16", x=620, y=380, font=35,disp=VKAdisp(16),code=VKAcode(16)}),
newSwitch({name="b17", x=620, y=440, font=35,disp=VKAdisp(17),code=VKAcode(17)}),
newSwitch({name="b18", x=620, y=500, font=35,disp=VKAdisp(18),code=VKAcode(18)}),
newSwitch({name="b19", x=620, y=560, font=35,disp=VKAdisp(19),code=VKAcode(19)}),
newSwitch({name="b20", x=620, y=620, font=35,disp=VKAdisp(20),code=VKAcode(20)}),
newButton({name="norm", x=840, y=100, w=240,h=80,color="white",font=35,code=function()for i=1,20 do VK_org[i].ava=i<11 end end}),
newButton({name="pro", x=1120, y=100, w=240,h=80,color="white",font=35,code=function()for i=1,20 do VK_org[i].ava=true end end}),
newSwitch({name="hide", x=1170, y=200, font=40,disp=SETval("VKSwitch"),code=SETrev("VKSwitch")}),
newSwitch({name="track", x=1170, y=300, font=35,disp=SETval("VKTrack"),code=SETrev("VKTrack")}),
newSlider({name="sfx", x=800, y=380, w=180,unit=4,font=40,change=function()SFX.play("virtualKey",setting.VKSFX*.25)end,disp=SETval("VKSFX"),code=SETsto("VKSFX")}),
newSlider({name="vib", x=800, y=460, w=180,unit=2,font=40,change=function()VIB(setting.VKVIB)end,disp=SETval("VKVIB"),code=SETsto("VKVIB")}),
newSwitch({name="icon", x=850, y=300, font=40,disp=SETval("VKIcon"),code=SETrev("VKIcon")}),
newButton({name="tkset", x=1120, y=420, w=240,h=80,color="white",font=32,
code=function()
SCN.goto("setting_trackSetting")
end,
hide=function()
return not setting.VKTrack
end}),
newSlider({name="alpha", x=840, y=540, w=400,unit=10,font=40,disp=SETval("VKAlpha"),code=SETsto("VKAlpha")}),
newButton({name="back", x=1120, y=620, w=200,h=80,color="white",font=45,code=BACK}),
},
setting_trackSetting={
newSwitch({name="VKDodge", x=400, y=200, font=35, disp=SETval("VKDodge"),code=SETrev("VKDodge")}),
newSlider({name="VKTchW", x=140, y=310, w=1000, unit=10,font=35,disp=SETval("VKTchW"),code=function(i)setting.VKTchW=i;setting.VKCurW=math.max(setting.VKCurW,i)end}),
newSlider({name="VKCurW", x=140, y=370, w=1000, unit=10,font=35,disp=SETval("VKCurW"),code=function(i)setting.VKCurW=i;setting.VKTchW=math.min(setting.VKTchW,i)end}),
newButton({name="back", x=1080, y=600, w=240, h=80,color="white",font=45,code=BACK}),
},
setting_lang={
newButton({name="chi", x=160, y=100,w=200,h=120,color="white",font=45,code=setLang(1)}),
newButton({name="chi2", x=380, y=100,w=200,h=120,color="white",font=45,code=setLang(2)}),
newButton({name="eng", x=600, y=100,w=200,h=120,color="white",font=45,code=setLang(3)}),
newButton({name="str", x=820, y=100,w=200,h=120,color="white",font=45,code=setLang(4)}),
newButton({name="back", x=640, y=600,w=200,h=80,color="white",font=40,code=BACK}),
},
help={
newButton({name="staff", x=980, y=500,w=150,h=80,color="white",font=32,code=function()SCN.goto("staff")end}),
newButton({name="his", x=1160, y=500,w=150,h=80,color="white",font=32,code=function()SCN.goto("history")end}),
newButton({name="qq", x=1070, y=600,w=200,h=80,color="white",font=32,code=function()love.system.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end,hide=mobileHide}),
newButton({name="back", x=640, y=600,w=200,h=80,color="white",font=40,code=BACK}),
},
staff={
newButton({name="back", x=1160, y=630,w=150,h=80,color="white",font=40,code=BACK}),
},
history={
newButton({name="prev", x=1155, y=170,w=180,h=180,color="white",font=65,code=pressKey("up"),hide=function()return sceneTemp[2]==1 end}),
newButton({name="next", x=1155, y=400,w=180,h=180,color="white",font=65,code=pressKey("down"),hide=function()return sceneTemp[2]==#sceneTemp[1]end}),
newButton({name="back", x=1155, y=600,w=180,h=90,color="white",font=40,code=BACK}),
},
stat={
newButton({name="path", x=980, y=620,w=250,h=80,color="white",font=25,code=function()love.system.openURL(love.filesystem.getSaveDirectory())end,hide=mobileHide}),
newButton({name="back", x=640, y=620,w=200,h=80,color="white",font=40,code=BACK}),
},
debug={
newButton({name="killWTM", x=340, y=200,w=260,h=100,color="white",font=35,
code=function()
marking=nil
TEXT.show("\68\69\86\58\87\97\116\101\114\109\97\114\107\32\82\101\109\111\118\101\100",640,360,60,"stretch",.6)
SFX.play("clear")
end,
hide=function()
return not marking
end}),
newButton({name="unlock", x=640,y=200,w=260,h=100,color="white",font=40,
code=function()
for name,M in next,Modes do
if not modeRanks[name]then
modeRanks[name]=M.score and 0 or 6
end
end
FILE.saveUnlock()
TEXT.show("\68\69\86\58\85\78\76\79\67\75\65\76\76",640,360,60,"stretch",.6)
SFX.play("clear_2")
end}),
newButton({name="reset", x=940,y=200,w=260,h=100,color="white",font=40,
code=function()
sceneTemp.ct=sceneTemp.ct+1
if sceneTemp.ct==1 then
TEXT.show("RESET ALL DATA?",640,360,50,"appear",.5)
elseif sceneTemp.ct==5 then
TEXT.show("SURE?????",640,360,80,"beat",.5)
elseif sceneTemp.ct==10 then
local L=love.filesystem.getDirectoryItems("")
for i=1,#L do
local s=L[i]
if s:sub(-4)==".dat"then
love.filesystem.remove(s)
end
end
SFX.play("clear_4")SFX.play("finesseError_long")
TEXT.clear()
TEXT.show("ALL SAVING FILE DELETED",640,360,60,"stretch",.4)
SCN.back()
end
end}),
newButton({name="back", x=640,y=620,w=200,h=80,color="white",font=40,code=BACK}),
},
}
--Remove temp vars
mobileHide,SETval,SETsto,SETrev=nil
pressKey,setPen,prevSkin,nextSkin=nil
nextDir,VKAdisp,VKAcode,setLang=nil
newText,newImage,newButton,newSwitch,newSlider=nil
return Widgets

View File

@@ -1,12 +1,11 @@
gameVersion="Alpha V0.8.22"
gameVersion="Alpha V0.9.3"
function love.conf(t)
t.identity="Techmino"--folder name
t.identity="Techmino"--saving folder
t.version="11.1"
t.console=false
t.gammacorrect=false
t.appendidentity=true--search files in source before save directory
t.appendidentity=true--search files in source then in save directory
t.accelerometerjoystick=false--accelerometer=joystick on ios/android
t.audio.mixwithsystem=true
if t.audio then t.audio.mixwithsystem=true end
local W=t.window
W.title="Techmino "..gameVersion
@@ -17,12 +16,12 @@ function love.conf(t)
W.resizable=true
W.fullscreentype="desktop"--"exclusive"
W.fullscreen=false
W.vsync=0--infinite fps
W.vsync=nil--60FPS
W.msaa=false--num of samples to use with multi-sampled antialiasing
W.depth=0--bits/samp of depth buffer
W.stencil=1--bits/samp of stencil buffer
W.display=1--monitor ID
W.highdpi=false--high-dpi mode for the window on a Retina display
W.highdpi=true--high-dpi mode for the window on a Retina display
W.x,W.y=nil
local M=t.modules

View File

@@ -56,60 +56,60 @@ back to back(B2B)点数说明:
在拼图模式下,按功能键切换是否展示提示.其中打"X"的格子不允许有方块,空的格子可以是任何状态,普通的七种彩色方块必须颜色对应,垃圾行方块的为止只要有方块就可以,但是不能是空气,玩家拼出自己画的图后就会判定胜利.
Gameplay:
System will offer a series of tetrominoes ("Pieces". There are 7 types), and the player needs to control [them] (move left and right, rotate 90, 180 or 270 degrees), filling a row on the play field will clear it, attack will be sent depending on the type of the line clear (if there is an opponent)
Survive till the last or complete the level's goal to win.
System will offer a series of tetrominoes ("Pieces". There are 7 types), and the player needs to control [them] (move left and right, rotate 90, 180 or 270 degrees), filling a row on the play field will clear it, attack will be sent depending on the type of the line clear (if there is an opponent)
Survive till the last or complete the level's goal to win.
Rotation system:
Uses Techmino's custom rotation system. Too lazy to write the details
Uses Techmino's custom rotation system. Too lazy to write the details
Spin detection:
Combines immobile and 3-corner detection, and whether a spin is mini also depends on the data used for detection. Also too lazy to write the details
Combines immobile and 3-corner detection, and whether a spin is mini also depends on the data used for detection. Also too lazy to write the details
Attack system:
Regular line clears:
Single/Double/Triple/Techrash sends 0.25/1.25/2.25/4
Special line clears:
Spin Single/Double/Triple sends 2/4/6, half if Mini
B2B: +1 (Techrash/Spin Single/Spin Double) or +2 (Spin Triple)
B2B2B/B3B: In addition to B2B, +1 if Techrash, +(0.5 * lines cleared) if Spin, and in both cases +1 additional blocking
Wide Combo: 0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 3, then 2 afterwards
Dig Combo: 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, then 5 afterwards
Special line clears will increase B2B gauge, making later special line clears have B2B or B2B2B bonus (see below)
Half Perfect Clear (a Perfect Clear "with blocks left below". If it's an I clearing 1 line, then the remaining blocks must not be player-placed): Attack +2, Extra Blocking +2
Perfect Clear: square root all damage above, then +6 to +12 attack (increases within a round) and +2 extra blocking. (note: if lines cleared in this round >4, then B2B gauge will be filled)
After calculating all above, the damage value will be rounded down then sent
Regular line clears:
Single/Double/Triple/Techrash sends 0.25/1.25/2.25/4
Special line clears:
Spin Single/Double/Triple sends 2/4/6, half if Mini
B2B: +1 (Techrash/Spin Single/Spin Double) or +2 (Spin Triple)
B2B2B/B3B: In addition to B2B, +1 if Techrash, +(0.5 * lines cleared) if Spin, and in both cases +1 additional blocking
Wide Combo: 0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 3, then 2 afterwards
Dig Combo: 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, then 5 afterwards
Special line clears will increase B2B gauge, making later special line clears have B2B or B2B2B bonus (see below)
Half Perfect Clear (a Perfect Clear "with blocks left below". If it's an I clearing 1 line, then the remaining blocks must not be player-placed): Attack +2, Extra Blocking +2
Perfect Clear: square root all damage above, then +6 to +12 attack (increases within a round) and +2 extra blocking. (note: if lines cleared in this round >4, then B2B gauge will be filled)
After calculating all above, the damage value will be rounded down then sent
Score system:
The more impressive you play, the more score you get
The more impressive you play, the more score you get
Attack delay:
Attack from Doubles/Triples take effect the faster, then Techrash, Spins send rather slow attack, and high combos will send the slowest
B2B or B2B2B, while they increase lines sent, they also increase the attack delay. Minis will greatly increase delay.
Attack from Doubles/Triples take effect the faster, then Techrash, Spins send rather slow attack, and high combos will send the slowest
B2B or B2B2B, while they increase lines sent, they also increase the attack delay. Minis will greatly increase delay.
Countering:
When you send attack, if there is garbage in queue, extra blocking will be used first, then attack, countering the earliest attack at a 1:1 ratio.
Unused extra blocking will be discarded, then remaining attack will be sent to your opponent.
When you send attack, if there is garbage in queue, extra blocking will be used first, then attack, countering the earliest attack at a 1:1 ratio.
Unused extra blocking will be discarded, then remaining attack will be sent to your opponent.
Back to Back (B2B) gauge:
The B2B gauge ranges from 0 to 1,200. Special line clears are B2B if the gauge is >=40, B2B2B if >1,000.
A regular line clear -250
Spin Single/Double/Triple +50/100/180 (x40% if Mini)
Techrash +100
Spin without clearing lines +20, but gauge cannot exceed 1,000 with this method
When gauge is above 1,000, a drop without clearing lines -40 (cannot drop below 1,000 with this method)
The B2B gauge ranges from 0 to 1,200. Special line clears are B2B if the gauge is >=40, B2B2B if >1,000.
A regular line clear -250
Spin Single/Double/Triple +50/100/180 (x40% if Mini)
Techrash +100
Spin without clearing lines +20, but gauge cannot exceed 1,000 with this method
When gauge is above 1,000, a drop without clearing lines -40 (cannot drop below 1,000 with this method)
Battle Royale modes:
Many players play within one game (all opponents are bots, not real players). As players get eliminated, blocks fall faster, and garbage take effect faster, as well as rise faster. KO-ing another player grants you one badge plus all badge that player has, increasing your attack power.
Players can select one of 4 attack modes:
1. Random: Every time you attack, 10% chance to lock onto a random player.
2. Badges: After you attack or when your target dies, lock onto the player with the most badges.
3. KOs: After you attack or when your target dies, lock onto the player with the highest field. (This refreshes every second)
4. Counter: attack all players locking onto yourself. Your attack will be sent to all of them. If you are not targetted, you attack a random player (not locking).
The last survivor wins.
Many players play within one game (all opponents are bots, not real players). As players get eliminated, blocks fall faster, and garbage take effect faster, as well as rise faster. KO-ing another player grants you one badge plus all badge that player has, increasing your attack power.
Players can select one of 4 attack modes:
1. Random: Every time you attack, 10% chance to lock onto a random player.
2. Badges: After you attack or when your target dies, lock onto the player with the most badges.
3. KOs: After you attack or when your target dies, lock onto the player with the highest field. (This refreshes every second)
4. Counter: attack all players locking onto yourself. Your attack will be sent to all of them. If you are not targetted, you attack a random player (not locking).
The last survivor wins.
Custom mode:
You can freely adjust most parameters (not including special effects of other game modes), and you can also draw a field to clear or make a template to build.
In build (puzzle) mode, you can toggle template display with Function key. Cells with a X cannot have blocks; empty cells can be in any state; regular colored cells have to be made of the corresponding block; garbage-colored cells can be any block but not air. Once you make the shape, you will win.
You can freely adjust most parameters (not including special effects of other game modes), and you can also draw a field to clear or make a template to build.
In build (puzzle) mode, you can toggle template display with Function key. Cells with a X cannot have blocks; empty cells can be in any state; regular colored cells have to be made of the corresponding block; garbage-colored cells can be any block but not air. Once you make the shape, you will win.
附录Appendix:
ZXC's cool O-spin map:XY0BCgAwCAIR7v9vHtUSt8AS0xKqgpnNGyXkrmFNePf6qi3BbQPrHT2Owxe6D66NeKi86dwB

BIN
font.ttf

Binary file not shown.

BIN
image/mess/hbm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
image/mess/title_new.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
image/skin/WTF.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
image/skin/classic(_).png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

BIN
image/skin/paper(mrz).png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -1,9 +1,20 @@
--[[
Techmino is my first "huge project"
optimization is welcomed if you also love tetromino game
______ __ _
/_ __/___ _____ / /_ ____ ___ (_)____ ____
/ / / _ \ / ___// __ \ / __ `__ \ / // __ \ / __ \
/ / / __// /__ / / / // / / / / // // / / // /_/ /
/_/ \___/ \___//_/ /_//_/ /_/ /_//_//_/ /_/ \____/
Techmino is my first "huge project"
optimization is welcomed if you also love tetromino game
]]
--Global Setting & Vars
math.randomseed(os.time()*626)
--Global vars
love.keyboard.setKeyRepeat(true)
love.keyboard.setTextInput(false)
love.mouse.setVisible(false)
function NULL()end
system=love.system.getOS()
game={}
mapCam={
@@ -20,53 +31,42 @@ mapCam={
--for auto zooming when enter/leave scene
}
scr={x=0,y=0,w=0,h=0,rad=0,k=1}--wid,hei,radius,scale K
customSel={1,22,1,1,7,3,1,1,8,4,1,1,1}
preField={h=20}for i=1,20 do preField[i]={0,0,0,0,0,0,0,0,0,0}end
function NULL()end
preBag={}
players={alive={},human=0}
--blockSkin,blockSkinMini={},{}--redefined in SKIN.change
require("Zframework")--load Zframework
--Load modules
setFont=require("parts/setfont")
color=require("parts/color")
blocks=require("parts/mino")
SHADER=require("parts/shader")
AITemplate=require("parts/AITemplate")
freeRow=require("parts/freeRow")
tickEvent=require("parts/tickEvent")
blocks= require("parts/mino")
AITemplate= require("parts/AITemplate")
freeRow= require("parts/freeRow")
require("parts/list")
require("toolfunc")
require("texture")
SCN=require("scene")
VIB=require("parts/vib")
SFX=require("parts/sfx")
sysFX=require("parts/sysFX")
BGM=require("parts/bgm")
VOC=require("parts/voice")
SKIN=require("parts/skin")
LANG=require("parts/languages")
FILE=require("parts/file")
TEXT=require("parts/text")
TASK=require("parts/task")
BG=require("parts/bg")
IMG=require("parts/img")
WIDGET=require("parts/widget")
LIGHT=require("parts/light")
require("parts/modes")
require("parts/gametoolfunc")
require("parts/default_data")
require("parts/ai")
PLY=require("player")
widgetList=require("widgetList")
require("callback")
TEXTURE=require("parts/texture")
SKIN= require("parts/skin")
PLY= require("parts/player")
AIfunc= require("parts/ai")
Modes= require("parts/modes")
TICK= require("parts/tick")
--load files & settings
modeRanks={sprint_10=0}
local fs=love.filesystem
if fs.getInfo("keymap.dat")then fs.remove("keymap.dat")end
if fs.getInfo("setting.dat")then fs.remove("setting.dat")end
if fs.getInfo("settings.dat")then FILE.loadSetting()
if fs.getInfo("settings.dat")then
FILE.loadSetting()
else
-- firstRun=true
if system=="Android"or system=="iOS" then
@@ -82,4 +82,28 @@ if setting.fullscreen then love.window.setFullscreen(true)end
if fs.getInfo("unlock.dat")then FILE.loadUnlock()end
if fs.getInfo("data.dat")then FILE.loadData()end
if fs.getInfo("key.dat")then FILE.loadKeyMap()end
if fs.getInfo("virtualkey.dat")then FILE.loadVK()end
if fs.getInfo("virtualkey.dat")then FILE.loadVK()end
if fs.getInfo("tech_ultimate.dat")then fs.remove("tech_ultimate.dat")end
if fs.getInfo("tech_ultimate+.dat")then fs.remove("tech_ultimate+.dat")end
--update data file
S=stat
while #modeRanks>73 do
table.remove(modeRanks)
end
if modeRanks[73]==6 then modeRanks[73]=0 end
if modeRanks[1]then--rename key of modeRanks
local L=modeRanks
for i=1,#L do
L[Modes[i].name],L[i]=L[i]
end
end
if S.version=="Alpha V0.9.1"or type(setting.spawn)~="number"then
setting.spawn=0
end
if S.version~=gameVersion then
S.version=gameVersion
TEXT.show(text.newVersion,640,200,30,"fly",.3)
end
S=nil

View File

@@ -12,7 +12,7 @@ local function score(P)
end
return{
color=color.lightBlue,
color=color.lBlue,
env={
noFly=true,
minarr=1,
@@ -45,7 +45,7 @@ return{
mStr(P.modeData.event,-81,110)
setFont(75)
mStr(P.stat.row,-81,220)
mStr(P.stat.clear_S[4],-81,340)
mStr(P.stat.clears[4],-81,340)
end,
score=function(P)return{P.modeData.point,P.stat.score}end,
scoreDisp=function(D)return sectionName[int(D[1]*.1)+1].." "..D[2]end,

View File

@@ -23,9 +23,8 @@ return{
end
B.sum=B.sum+22
P.stat.recv=P.stat.recv+22
if D.event<50 then
D.event=D.event+1
D.point=int(72e4/t)*.1
D.event=D.event+1
if D.event%10==0 then
if D.event==20 then
P:showTextF(text.great,0,-140,100,"appear",.6)
P.gameEnv.pushSpeed=3
@@ -35,7 +34,7 @@ return{
end
end
end,
bg="game3",bgm="push",
bg="game4",bgm="push",
},
pauseLimit=true,
load=function()

View File

@@ -1,38 +1,37 @@
local int,rnd=math.floor,math.random
local int,rnd,min=math.floor,math.random,math.min
return{
color=color.lightYellow,
color=color.lYellow,
env={
drop=5,lock=60,
fall=8,
freshLimit=15,
task=function(P)
if not(P.control and SCN.cur=="play")then return end
if P.atkBuffer.sum<2 then
if P.atkBuffer.sum<4 then
local p=#P.atkBuffer+1
local B,D=P.atkBuffer,P.modeData
local s,t
if D.event<10 then
t=1000-20*D.event--1000~800
B[p]= {pos=rnd(5,6),amount=10,countdown=t,cd0=t,time=0,sent=false,lv=3}
B[p+1]= {pos=rnd(4,7),amount=12,countdown=t,cd0=t,time=0,sent=false,lv=4}
s=22
t=800-10*D.event--800~700
B[p]= {pos=rnd(5,6),amount=9,countdown=t,cd0=t,time=0,sent=false,lv=3}
B[p+1]= {pos=rnd(4,7),amount=11,countdown=t,cd0=t+62,time=0,sent=false,lv=4}
s=20
elseif D.event<20 then
t=800-20*(D.event-15)--800~600
t=800-10*D.event--700~600
B[p]= {pos=rnd(3,8),amount=11,countdown=t,cd0=t,time=0,sent=false,lv=4}
B[p+1]= {pos=rnd(4,7),amount=14,countdown=t,cd0=t,time=0,sent=false,lv=5}
s=25
B[p+1]= {pos=rnd(4,7),amount=13,countdown=t,cd0=t+62,time=0,sent=false,lv=5}
s=24
else
t=600-15*(D.event-30)--600~450
B[p]= {pos=rnd(2)*9-8,amount=12,countdown=t,cd0=t,time=0,sent=false,lv=5}
B[p+1]= {pos=rnd(3,8),amount=16,countdown=t,cd0=t,time=0,sent=false,lv=5}
t=600-15*(min(D.event-20,10))--600~450
B[p]= {pos=rnd(2)*9-8,amount=14,countdown=t,cd0=t,time=0,sent=false,lv=5}
B[p+1]= {pos=rnd(3,8),amount=14,countdown=t+62,cd0=t,time=0,sent=false,lv=5}
s=28
end
B.sum=B.sum+s
P.stat.recv=P.stat.recv+s
if D.event<45 then
D.event=D.event+1
D.point=int(s*36e3/t)*.1
if D.event==10 then
D.event=D.event+1
if D.event%10==0 then
if D.event==10 then
P:showTextF(text.great,0,-140,100,"appear",.6)
P.gameEnv.pushSpeed=4
elseif D.event==20 then

View File

@@ -7,7 +7,7 @@ local function newField(P)
end
return{
color=color.lightGrey,
color=color.lGrey,
env={
drop=1e99,lock=1e99,
hold=false,

View File

@@ -18,7 +18,7 @@ return{
mText(drawableText.techrash,-81,420)
setFont(75)
mStr(P.stat.row,-81,220)
mStr(P.stat.clear_S[4],-81,340)
mStr(P.stat.clears[4],-81,340)
end,
score=function(P)return{min(P.stat.row or 200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,

View File

@@ -21,9 +21,9 @@ return{
mText(drawableText.techrash,-81,420)
setFont(75)
mStr(P.stat.row,-81,220)
mStr(P.stat.clear_S[4],-81,340)
mStr(P.stat.clears[4],-81,340)
gc.setColor(1,1,1,.2)
gc.draw(IMG.electric,-26,120,0,2.6)
gc.draw(IMG.electric,-26,106,0,2.6)
end,
score=function(P)return{min(P.stat.row or 200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,

View File

@@ -22,9 +22,9 @@ return{
mText(drawableText.techrash,-81,420)
setFont(75)
mStr(P.stat.row,-81,220)
mStr(P.stat.clear_S[4],-81,340)
mStr(P.stat.clears[4],-81,340)
gc.setColor(1,1,1,.2)
gc.draw(IMG.electric,-26,120,0,2.6)
gc.draw(IMG.electric,-26,106,0,2.6)
end,
score=function(P)return{min(P.stat.row or 200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,

View File

@@ -20,9 +20,9 @@ return{
mText(drawableText.techrash,-81,420)
setFont(75)
mStr(P.stat.row,-81,220)
mStr(P.stat.clear_S[4],-81,340)
mStr(P.stat.clears[4],-81,340)
gc.setColor(1,1,1,.2)
gc.draw(IMG.electric,-26,120,0,2.6)
gc.draw(IMG.electric,-26,106,0,2.6)
end,
score=function(P)return{min(P.stat.row or 200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,

View File

@@ -4,7 +4,6 @@ return{
color=color.red,
env={
drop=30,lock=60,
fall=5,
block=false,
center=false,ghost=false,
dropFX=0,lockFX=0,
@@ -23,9 +22,9 @@ return{
mText(drawableText.techrash,-81,420)
setFont(75)
mStr(P.stat.row,-81,220)
mStr(P.stat.clear_S[4],-81,340)
mStr(P.stat.clears[4],-81,340)
gc.setColor(1,1,1,.2)
gc.draw(IMG.electric,-26,120,0,2.6)
gc.draw(IMG.electric,-26,106,0,2.6)
end,
score=function(P)return{min(P.stat.row or 200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,

60
modes/blind_wtf.lua Normal file
View File

@@ -0,0 +1,60 @@
local gc=love.graphics
local sin,min=math.sin,math.min
local Timer=love.timer.getTime
return{
color=color.red,
env={
drop=30,lock=60,
next=1,
block=false,
center=false,ghost=false,
dropFX=0,lockFX=0,
visible="none",
dropPiece=PLY.reach_winCheck,
freshLimit=15,
target=100,
bg="none",bgm="secret7th",
},
pauseLimit=true,
load=function()
PLY.newPlayer(1,340,15)
end,
mesDisp=function(P,dx,dy)
if not game.result then
gc.clear(.26,.26,.26)
end
--Figures
local t=Timer()
gc.setColor(1,1,1,.5+.2*sin(t))
gc.draw(IMG.hbm,-426,-86,0,1.5)
gc.draw(IMG.electric,326,142,0,2.6)
--Texts
gc.setColor(.8,.8,.8)
mText(drawableText.line,-81,300)
mText(drawableText.techrash,-81,420)
setFont(75)
mStr(P.stat.row,-81,220)
mStr(P.stat.clears[4],-81,340)
--"Field"
gc.setColor(.5,.5,.5)
gc.rectangle("line",-1,-11,302,612)
gc.rectangle("line",301,0,15,601)
gc.rectangle("line",-16,-3,15,604)
end,
score=function(P)return{min(P.stat.row or 200),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P)
local L=P.stat.row
return
L>=100 and 5 or
L>=60 and 4 or
L>=30 and 3 or
L>=10 and 2 or
L>=5 and 1 or
L>=1 and 0
end,
}

View File

@@ -59,7 +59,7 @@ return{
if L==100 then
local T=P.stat.time
return
T<=40 and 5 or
T<=36 and 5 or
T<=60 and 4 or
3
else

View File

@@ -57,7 +57,7 @@ return{
if L==100 then
local T=P.stat.time
return
T<=30 and 5 or
T<=32 and 5 or
T<=50 and 4 or
T<=80 and 3 or
2

View File

@@ -14,7 +14,7 @@ local function check_LVup(P)
end
return{
color=color.lightBlue,
color=color.lBlue,
env={
noFly=true,
das=16,arr=6,sddas=2,sdarr=2,

View File

@@ -12,6 +12,11 @@ return{
end
modeEnv._20G=modeEnv.drop==0
modeEnv.oncehold=customSel[6]==1
if preBag[1]then
modeEnv.bag=preBag
else
modeEnv.bag=nil
end
PLY.newPlayer(1,340,15)
local L=modeEnv.opponent
if L~=0 then

View File

@@ -31,6 +31,7 @@ return{
end
modeEnv._20G=modeEnv.drop==0
modeEnv.oncehold=customSel[6]==1
if preBag[1]then modeEnv.bag=preBag end
modeEnv.target=0
PLY.newPlayer(1,340,15)
local L=modeEnv.opponent

View File

@@ -37,7 +37,7 @@ return{
end
end
end,
bg="game3",bgm="way",
bg="game4",bgm="way",
},
pauseLimit=true,
load=function()

View File

@@ -1,6 +1,6 @@
local max,rnd=math.max,math.random
return{
color=color.lightYellow,
color=color.lYellow,
env={
drop=10,lock=30,
freshLimit=15,
@@ -9,7 +9,7 @@ return{
local D=P.modeData
D.counter=D.counter+1
if D.counter>=max(30,80-.3*D.event)then
P:garbageRise(11+D.event%3,1,rnd(10))
P:garbageRise(13+D.event%5,1,rnd(10))
P.stat.recv=P.stat.recv+1
D.counter=0
D.event=D.event+1

View File

@@ -10,13 +10,19 @@ return{
if not P.next[1] then
local height=freeRow.get(0)
local max=#P.field
for x=1,10 do
local h=max
while P.field[h][x]==0 and h>1 do
h=h-1
if max>0 then
for x=1,10 do
local h=max
while P.field[h][x]==0 and h>1 do
h=h-1
end
height[x]=h
end--get heights
else
for x=1,10 do
height[x]=0
end
height[x]=h
end--get heights
end
height[11]=999
local res={1,1,2,2,3,4}
@@ -27,9 +33,11 @@ return{
end
if d<40 or P.stat.row>2*42 then
A=#res+1
for i=A,A+5 do
res[i]=1
res[i+6]=2
for i=1,4 do
res[A]=1
res[A+1]=2
res[A+2]=6
A=A+3
end
goto END
end
@@ -105,8 +113,8 @@ return{
if L>=100 then
local T=P.stat.time
return
T<=70 and 5 or
T<=110 and 4 or
T<=90 and 5 or
T<=105 and 4 or
T<=160 and 3 or
T<=240 and 2 or
1

View File

@@ -1,6 +1,6 @@
local format=string.format
return{
color=color.lightGrey,
color=color.lGrey,
env={
drop=1e99,lock=1e99,
oncehold=false,
@@ -22,7 +22,7 @@ return{
getRank=function(P)
local L=P.stat.row
return
L>=2600 and 5 or
L>=2000 and 5 or
L>=1500 and 4 or
L>=1000 and 3 or
L>=500 and 2 or

View File

@@ -21,7 +21,7 @@ return{
mindas=7,minarr=1,minsdarr=1,
drop=.5,wait=8,fall=20,
target=50,dropPiece=check,
bg="strap",bgm="push",
bg="game2",bgm="push",
},
pauseLimit=true,
slowMark=true,

View File

@@ -21,7 +21,7 @@ return{
wait=8,fall=20,
target=10,dropPiece=check_LVup,
mindas=7,minarr=1,minsdarr=1,
bg="strap",bgm="push",
bg="game2",bgm="push",
},
pauseLimit=true,
slowMark=true,

View File

@@ -36,7 +36,7 @@ return{
color=color.red,
env={
noFly=true,
mindas=6,minarr=1,
das=6,arr=1,
_20G=true,
lock=death_lock[1],
wait=death_wait[1],
@@ -63,16 +63,16 @@ return{
getRank=function(P)
local S=P.modeData.point
if S==500 then
local L=P.stat.clear_S[4]
local T=P.stat.time
return
L>=30 and 5 or
L>=25 and 4 or
3
T<=118 and 5 or
T<=148 and 4 or
T<=183 and 3 or
2
else
return
S>=426 and 3 or
S>=326 and 2 or
S>=226 and 1 or
S>=300 and 2 or
S>=100 and 1 or
S>=50 and 0
end
end,

View File

@@ -47,7 +47,7 @@ return{
fall=rush_fall[1],
dropPiece=score,
freshLimit=15,
bg="strap",bgm="secret8th",
bg="game1",bgm="secret8th",
},
slowMark=true,
load=function()
@@ -67,7 +67,7 @@ return{
getRank=function(P)
local S=P.modeData.point
if S==500 then
local L=P.stat.clear_S[4]
local L=P.stat.clears[4]
return
L>=30 and 5 or
L>=25 and 4 or

View File

@@ -12,12 +12,12 @@ local function score(P)
if MD.point%100==99 then SFX.play("blip_1")end
if int(MD.point*.01)>MD.event then
local s=MD.event+1;MD.event=s--level up!
P:showTextF(text.stage(s),0,-120,80,"fly")
local E=P.gameEnv
if s<4 then--first 300
if s~=1 then E.lock=E.lock-1 end
if s~=2 then E.wait=E.wait-1 end
if s~=3 then E.fall=E.fall-1 end
P:showTextF(text.stage(s),0,-120,80,"fly")
elseif s<10 then
if s==4 or s==7 then E.das=E.das-1 end
s=s%3
@@ -25,6 +25,7 @@ local function score(P)
elseif s==1 then E.wait=E.wait-1
elseif s==2 then E.fall=E.fall-1
end
P:showTextF(text.stage(s),0,-120,80,"fly")
else
MD.point,MD.event=1000,9
P:win("finish")
@@ -34,10 +35,10 @@ local function score(P)
end
return{
color=color.lightGrey,
color=color.lGrey,
env={
noFly=true,
mindas=5,minarr=1,
das=5,arr=1,
_20G=true,lock=12,
wait=10,fall=10,
dropPiece=score,

View File

@@ -27,7 +27,7 @@ return{
getRank=function(P)
local L=P.stat.pc
return
L>=25 and 5 or
L>=24 and 5 or
L>=20 and 4 or
L>=16 and 3 or
L>=13 and 2 or

View File

@@ -31,7 +31,7 @@ local function newPC(P)
P.modeData.symmetry=symmetry
P:pushNext(L,symmetry)
P.modeData.counter=P.stat.piece==0 and 20 or 0
TASK.new(task_PC,P)
P:newTask(task_PC)
local s=P.stat.pc*.25
if int(s)==s and s>0 then

View File

@@ -37,7 +37,7 @@ local function newPC(P)
P.modeData.symmetry=symmetry
P:pushNext(L,symmetry)
P.modeData.counter=P.stat.piece==0 and 20 or 0
TASK.new(task_PC,P)
P:newTask(task_PC)
end
end
return{

View File

@@ -16,7 +16,7 @@ return{
drop=1e99,lock=1e99,
oncehold=false,
dropPiece=update_round,
bg="game2",bgm="push",
bg="game3",bgm="push",
},
load=function()
PLY.newPlayer(1,340,15)

View File

@@ -16,7 +16,7 @@ return{
drop=1e99,lock=1e99,
oncehold=false,
dropPiece=update_round,
bg="game2",bgm="push",
bg="game3",bgm="push",
},
load=function()
PLY.newPlayer(1,340,15)

View File

@@ -16,7 +16,7 @@ return{
drop=1e99,lock=1e99,
oncehold=false,
dropPiece=update_round,
bg="game2",bgm="push",
bg="game3",bgm="push",
},
load=function()
PLY.newPlayer(1,340,15)

View File

@@ -16,7 +16,7 @@ return{
drop=1e99,lock=1e99,
oncehold=false,
dropPiece=update_round,
bg="game2",bgm="push",
bg="game3",bgm="push",
},
load=function()
PLY.newPlayer(1,340,15)

View File

@@ -11,12 +11,12 @@ local function update_round(P)
end
return{
color=color.lightYellow,
color=color.lYellow,
env={
drop=1e99,lock=1e99,
oncehold=false,
dropPiece=update_round,
bg="game2",bgm="push",
bg="game3",bgm="push",
},
load=function()
PLY.newPlayer(1,340,15)

View File

@@ -1,5 +1,5 @@
return{
color=color.lightYellow,
color=color.lYellow,
env={
drop=60,lock=60,
freshLimit=15,

View File

@@ -25,7 +25,7 @@ return{
end,
score=function(P)return{P.stat.time,P.stat.piece}end,
scoreDisp=function(D)return toTime(D[1]).." "..D[2].." Pieces"end,
comp=function(a,b)return a[1]<b[1]or a[1]==b[1]and a[2]<b[2]end,
comp=function(a,b)return a[2]>b[2]or a[2]==b[2]and a[1]<b[1]end,
getRank=function(P)
local T=P.stat.row
if T<5 then

View File

@@ -5,7 +5,7 @@ return{
env={
drop=60,lock=60,
target=10,dropPiece=PLY.reach_winCheck,
bg="strap",bgm="race",
bg="game2",bgm="race",
},
load=function()
PLY.newPlayer(1,340,15)

View File

@@ -5,7 +5,7 @@ return{
env={
drop=60,lock=60,
target=100,dropPiece=PLY.reach_winCheck,
bg="strap",bgm="race",
bg="game2",bgm="race",
},
load=function()
PLY.newPlayer(1,340,15)
@@ -32,8 +32,8 @@ return{
T<=62 and 5 or
T<=90 and 4 or
T<=130 and 3 or
T<=200 and 2 or
T<=360 and 1 or
T<=196 and 2 or
T<=260 and 1 or
0
end,
}

View File

@@ -1,11 +1,11 @@
local gc=love.graphics
local rnd=math.random
return{
color=color.lightGrey,
color=color.lGrey,
env={
drop=60,lock=60,
target=1000,dropPiece=PLY.reach_winCheck,
bg="strap",bgm="push",
bg="game3",bgm="push",
},
load=function()
PLY.newPlayer(1,340,15)
@@ -30,10 +30,10 @@ return{
local T=P.stat.time
return
T<=626 and 5 or
T<=1000 and 4 or
T<=1400 and 3 or
T<=2260 and 2 or
T<=3260 and 1 or
T<=888 and 4 or
T<=1140 and 3 or
T<=1406 and 2 or
T<=1626 and 1 or
0
end,
}

View File

@@ -1,11 +1,11 @@
local gc=love.graphics
local rnd=math.random
return{
color=color.lightBlue,
color=color.lBlue,
env={
drop=60,lock=60,
target=20,dropPiece=PLY.reach_winCheck,
bg="strap",bgm="race",
bg="game2",bgm="race",
},
load=function()
PLY.newPlayer(1,340,15)

View File

@@ -5,7 +5,7 @@ return{
env={
drop=60,lock=60,
target=40,dropPiece=PLY.reach_winCheck,
bg="strap",bgm="race",
bg="game2",bgm="race",
},
load=function()
PLY.newPlayer(1,340,15)

View File

@@ -5,7 +5,7 @@ return{
env={
drop=60,lock=60,
target=400,dropPiece=PLY.reach_winCheck,
bg="strap",bgm="push",
bg="game3",bgm="push",
},
load=function()
PLY.newPlayer(1,340,15)
@@ -32,8 +32,8 @@ return{
T<=255 and 5 or
T<=326 and 4 or
T<=462 and 3 or
T<=626 and 2 or
T<=1260 and 1 or
T<=555 and 2 or
T<=626 and 1 or
0
end,
}

View File

@@ -1,6 +1,6 @@
local max,rnd=math.max,math.random
return{
color=color.lightYellow,
color=color.lYellow,
env={
drop=5,lock=60,
fall=10,

View File

@@ -3,6 +3,9 @@ local function tech_check_hard(P)
if #P.clearedRow>0 and P.lastClear<10 or P.lastClear==74 then
P:lose()
end
if P.stat.row>=200 then
P:win("finish")
end
end
return{

View File

@@ -1,12 +1,13 @@
local format=string.format
return{
color=color.lightYellow,
color=color.lYellow,
env={
arr=0,
drop=1e99,lock=60,
freshLimit=15,
target=200,
dropPiece=PLY.reach_winCheck,
fineKill=true,
bg="flink",bgm="infinite",
},

View File

@@ -3,10 +3,13 @@ local function tech_check_hard(P)
if #P.clearedRow>0 and P.lastClear<10 or P.lastClear==74 then
P:lose()
end
if P.stat.row>=200 then
P:win("finish")
end
end
return{
color=color.darkMagenta,
color=color.dMagenta,
env={
drop=30,lock=60,
freshLimit=15,

View File

@@ -3,6 +3,9 @@ local function tech_check_easy(P)
if #P.clearedRow>0 and P.b2b<40 then
P:lose()
end
if P.stat.row>=200 then
P:win("finish")
end
end
return{

View File

@@ -3,10 +3,13 @@ local function tech_check_hard(P)
if #P.clearedRow>0 and P.lastClear<10 or P.lastClear==74 then
P:lose()
end
if P.stat.row>=200 then
P:win("finish")
end
end
return{
color=color.darkRed,
color=color.dRed,
env={
_20G=true,lock=60,
freshLimit=15,

View File

@@ -3,6 +3,9 @@ local function tech_check_easy(P)
if #P.clearedRow>0 and P.b2b<40 then
P:lose()
end
if P.stat.row>=200 then
P:win("finish")
end
end
return{

View File

@@ -3,10 +3,13 @@ local function tech_check_hard(P)
if #P.clearedRow>0 and P.lastClear<10 or P.lastClear==74 then
P:lose()
end
if P.stat.row>=200 then
P:win("finish")
end
end
return{
color=color.darkGreen,
color=color.dGreen,
env={
oncehold=false,
drop=1e99,lock=1e99,

View File

@@ -3,6 +3,9 @@ local function tech_check_easy(P)
if #P.clearedRow>0 and P.b2b<40 then
P:lose()
end
if P.stat.row>=200 then
P:win("finish")
end
end
return{

View File

@@ -16,7 +16,7 @@ local function selectTarget(P)
end
return{
color=color.lightYellow,
color=color.lYellow,
env={
drop=15,lock=60,
fall=20,

View File

@@ -16,7 +16,7 @@ local function selectTarget(P)
end
return{
color=color.lightYellow,
color=color.lYellow,
env={
drop=15,lock=60,
fall=20,

Some files were not shown because too many files have changed in this diff Show More