Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3155bc48ef |
86
class.lua
86
class.lua
@@ -31,7 +31,10 @@ function clearTask(opt)
|
||||
end
|
||||
end
|
||||
|
||||
local button={type="button"}
|
||||
local button={
|
||||
type="button",
|
||||
ATV=0,--activating time(0~8)
|
||||
}
|
||||
function newButton(x,y,w,h,color,font,code,hide,N)
|
||||
local _={
|
||||
x=x-w*.5,y=y-h*.5,
|
||||
@@ -44,11 +47,18 @@ function newButton(x,y,w,h,color,font,code,hide,N)
|
||||
}for k,v in next,button do _[k]=v end return _
|
||||
end
|
||||
function button:isAbove(x,y)
|
||||
return x>self.x and x<self.x+self.w and y>self.y and y<self.y+self.h
|
||||
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:FX()
|
||||
sysFX[#sysFX+1]={0,0,10,self.x,self.y,self.w,self.h}
|
||||
--[0=ripple],timer,duration,x,y,w,h
|
||||
sysFX[#sysFX+1]={0,0,10,self.x-self.ATV,self.y-self.ATV,self.w+2*self.ATV,self.h+2*self.ATV}
|
||||
--0[ripple],timer,duration,x,y,w,h
|
||||
end
|
||||
function button:update()
|
||||
if widget_sel==self then
|
||||
if self.ATV<8 then self.ATV=self.ATV+1 end
|
||||
else
|
||||
if self.ATV>0 then self.ATV=self.ATV-1 end
|
||||
end
|
||||
end
|
||||
function button:draw()
|
||||
local x,y,w,h=self.x,self.y,self.w,self.h
|
||||
@@ -57,12 +67,12 @@ function button:draw()
|
||||
local sd=shader_glow
|
||||
sd:send("X",x)sd:send("Y",y)sd:send("W",w)sd:send("H",h)
|
||||
gc.setShader(sd)
|
||||
gc.rectangle("fill",x,y,w,h)
|
||||
gc.rectangle("fill",x-self.ATV,y-self.ATV,w+2*self.ATV,h+2*self.ATV)
|
||||
gc.setShader()
|
||||
if self==widget_sel then
|
||||
if self.ATV>0 then
|
||||
gc.setLineWidth(4)
|
||||
gc.setColor(1,1,1,.8)
|
||||
gc.rectangle("line",x+2,y+2,w-4,h-4)
|
||||
gc.setColor(1,1,1,self.ATV*.125)
|
||||
gc.rectangle("line",x-self.ATV+2,y-self.ATV+2,w+2*self.ATV-4,h+2*self.ATV-4)
|
||||
end
|
||||
local t=self.text
|
||||
if t then
|
||||
@@ -82,7 +92,10 @@ function button:getInfo()
|
||||
print(format("x=%d,y=%d,w=%d,h=%d,font=%d",self.x+self.w*.5,self.y+self.h*.5,self.w,self.h,self.font))
|
||||
end
|
||||
|
||||
local switch={type="switch"}
|
||||
local switch={
|
||||
type="switch",
|
||||
ATV=0,--activating time(0~8)
|
||||
}
|
||||
function newSwitch(x,y,font,disp,code,hide,N)
|
||||
local _={
|
||||
x=x,y=y,font=font,
|
||||
@@ -95,21 +108,30 @@ 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:FX()
|
||||
sysFX[#sysFX+1]=self.disp()and
|
||||
{1,0,15,.4,1,.4,self.x,self.y-25,50,50,0}--Switched on
|
||||
or{1,0,15,1,.4,.4,self.x,self.y-25,50,50,0}--Switched off
|
||||
--[1=square fade],timer,duration,r,g,b,x,y,w,h
|
||||
function switch:update()
|
||||
if widget_sel==self then
|
||||
if self.ATV<8 then self.ATV=self.ATV+1 end
|
||||
else
|
||||
if self.ATV>0 then self.ATV=self.ATV-1 end
|
||||
end
|
||||
end
|
||||
function switch:draw()
|
||||
local x,y=self.x,self.y-25
|
||||
if self.disp()then
|
||||
if self.ATV>0 then
|
||||
gc.setColor(1,.3,.3,self.ATV*.06)
|
||||
gc.rectangle("fill",x,y,50,50)
|
||||
end
|
||||
gc.setColor(.9,1,.9)
|
||||
gc.setLineWidth(6)
|
||||
gc.line(x+5,y+25,x+18,y+38,x+45,y+11)
|
||||
end--checked
|
||||
gc.setColor(1,1,1,self==widget_sel and .6 or .3)
|
||||
gc.rectangle("fill",x,y,50,50)
|
||||
else
|
||||
if self.ATV>0 then
|
||||
gc.setColor(.3,1,.3,self.ATV*.06)
|
||||
gc.rectangle("fill",x,y,50,50)
|
||||
end
|
||||
end
|
||||
--checked
|
||||
gc.setLineWidth(4)
|
||||
gc.setColor(1,1,1)
|
||||
gc.rectangle("line",x,y,50,50)
|
||||
@@ -125,7 +147,11 @@ function switch:getInfo()
|
||||
print(format("x=%d,y=%d,font=%d",self.x,self.y,self.font))
|
||||
end
|
||||
|
||||
local slider={type="slider"}
|
||||
local slider={
|
||||
type="slider",
|
||||
ATV=0,--activating time(0~8)
|
||||
pos=0,--position shown
|
||||
}
|
||||
function newSlider(x,y,w,unit,font,change,disp,code,hide,N)
|
||||
local _={
|
||||
x=x,y=y,
|
||||
@@ -141,13 +167,19 @@ 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:FX(pos)
|
||||
sysFX[#sysFX+1]={1,0,10,1,1,1,self.x+self.w*pos/self.unit-8,self.y-15,17,30}
|
||||
--[1=square fade],timer,duration,r,g,b,x,y,w,h
|
||||
function slider:update()
|
||||
if widget_sel==self then
|
||||
if self.ATV<6 then self.ATV=self.ATV+1 end
|
||||
else
|
||||
if self.ATV>0 then self.ATV=self.ATV-1 end
|
||||
end
|
||||
if not(self.hide and self.hide())then
|
||||
self.pos=self.pos*.8+self.disp()*.2
|
||||
end
|
||||
end
|
||||
function slider:draw()
|
||||
local x,y=self.x,self.y
|
||||
gc.setColor(1,1,1,self==widget_sel and .7 or .5)
|
||||
gc.setColor(1,1,1,.5+self.ATV*.06)
|
||||
gc.setLineWidth(2)
|
||||
local x1,x2=x,x+self.w
|
||||
for p=0,self.unit do
|
||||
@@ -165,13 +197,13 @@ function slider:draw()
|
||||
gc.printf(t,x-312,y-self.font*.7,300,"right")
|
||||
end
|
||||
--text
|
||||
local x,y=x1+(x2-x1)*self.disp()/self.unit-9,y-16
|
||||
local x,y,w,h=x1+(x2-x1)*self.pos/self.unit-10-self.ATV,y-16-self.ATV,20+2*self.ATV,32+2*self.ATV
|
||||
gc.setColor(.8,.8,.8)
|
||||
gc.rectangle("fill",x,y,19,32)
|
||||
if self==widget_sel then
|
||||
gc.rectangle("fill",x,y,w,h)
|
||||
if self.ATV>0 then
|
||||
gc.setLineWidth(2)
|
||||
gc.setColor(1,1,1)
|
||||
gc.rectangle("line",x+1,y+1,18,30)
|
||||
gc.setColor(1,1,1,self.ATV*.16)
|
||||
gc.rectangle("line",x+1,y+1,w-2,h-2)
|
||||
end
|
||||
--block
|
||||
end
|
||||
|
||||
2
conf.lua
2
conf.lua
@@ -1,4 +1,4 @@
|
||||
gameVersion="Alpha V0.8.3"
|
||||
gameVersion="Alpha V0.8.4"
|
||||
function love.conf(t)
|
||||
t.identity="Techmino"--Save directory name
|
||||
t.version="11.1"
|
||||
|
||||
@@ -11,8 +11,8 @@ spin判定:
|
||||
攻击系统:
|
||||
消1/2/3/4攻击0/1/2/4
|
||||
spin1/2/3攻击2/4/6,若mini则减半
|
||||
b2b:增加1~2(tetris)/1~3(spin)攻击
|
||||
b3b:满b2b效果+1额外抵挡
|
||||
B2B:增加1~2(techrash)/1~3(spin)攻击
|
||||
B3B:满B2B效果+1额外抵挡
|
||||
PC:其它攻击与6~8(本局内递增)取高+2额外抵挡
|
||||
连击:0,0,1,1,2,2,3,3,4,4,3……
|
||||
|
||||
@@ -27,7 +27,7 @@ back to back(B2B)点数说明:
|
||||
|
||||
攻击延迟:
|
||||
消2/3的攻击生效最快,消四其次,spin攻击生效较慢,高连击生效最慢
|
||||
b2b或者b3b增加攻击力的同时也会减缓一点生效速度,mini大幅减缓生效速度
|
||||
B2B或者B3B增加攻击力的同时也会减缓一点生效速度,mini大幅减缓生效速度
|
||||
|
||||
抵消逻辑:
|
||||
发动攻击时,若缓冲条有攻击则先用额外抵挡再用攻击力1:1抵消最先受到的攻击
|
||||
|
||||
@@ -195,7 +195,7 @@ return{
|
||||
warning="禁 止 私 自 传 播",
|
||||
WidgetText={
|
||||
main={
|
||||
lang="Lang",
|
||||
lang="言/A",
|
||||
qplay="快速开始",
|
||||
play="开始",
|
||||
setting="设置",
|
||||
@@ -259,7 +259,8 @@ return{
|
||||
pause={
|
||||
resume= "继续",
|
||||
restart="重新开始",
|
||||
setting="设置",
|
||||
sfx="音效",
|
||||
bgm="音乐",
|
||||
quit= "退出",
|
||||
},
|
||||
setting_game={
|
||||
|
||||
@@ -195,7 +195,7 @@ return{
|
||||
warning="禁 止 私 自 传 播",
|
||||
WidgetText={
|
||||
main={
|
||||
lang="Lang",
|
||||
lang="言/A",
|
||||
qplay="快速开始",
|
||||
play="开始",
|
||||
setting="设置",
|
||||
@@ -259,7 +259,8 @@ return{
|
||||
pause={
|
||||
resume= "继续",
|
||||
restart="重新开始",
|
||||
setting="设置",
|
||||
sfx="音效",
|
||||
bgm="音乐",
|
||||
quit= "退出",
|
||||
},
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ Lib used:
|
||||
warning="DO NOT DISTRIBUTE",
|
||||
WidgetText={
|
||||
main={
|
||||
lang="Lang",
|
||||
lang="言/A",
|
||||
qplay="Qplay",
|
||||
play="Play",
|
||||
setting="Settings",
|
||||
@@ -258,7 +258,8 @@ Lib used:
|
||||
pause={
|
||||
resume="Resume",
|
||||
restart="Restart",
|
||||
setting="Setting",
|
||||
sfx="SFX",
|
||||
bgm="BGM",
|
||||
quit="Quit",
|
||||
},
|
||||
setting_game={
|
||||
|
||||
8
list.lua
8
list.lua
@@ -405,14 +405,12 @@ Widget={
|
||||
resetGameData()
|
||||
scene.swapTo("play","none")
|
||||
end),
|
||||
setting=newButton(1150,80,200,100,C.yellow,40,function()
|
||||
scene.push()
|
||||
scene.swapTo("setting_sound")
|
||||
end),
|
||||
sfx= newSlider(950,60,280,10,35,function()SFX("blip_1")end, SETdisp("sfx"),SETsto("sfx")),
|
||||
bgm= newSlider(950,120,280,10,35,function()BGM(bgmPlaying or"blank")end, SETdisp("bgm"),SETsto("bgm")),
|
||||
quit= newButton(640,600,240,100,C.white,45,scene.back),
|
||||
},
|
||||
setting_game={
|
||||
graphic=newButton(200,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_graphic")end, nil,"sound"),
|
||||
graphic=newButton(200,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_graphic")end,nil,"sound"),
|
||||
sound= newButton(1080,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_sound")end, nil,"dasD"),
|
||||
dasD= newButton(180,230,50,50,C.white,40,function()
|
||||
setting.das=(setting.das-1)%31
|
||||
|
||||
135
main.lua
135
main.lua
@@ -583,7 +583,8 @@ function touchMove.play(id,x,y,dx,dy)
|
||||
end
|
||||
function keyDown.play(key)
|
||||
if key=="escape"and not scene.swapping then
|
||||
return(frame<180 and back or pauseGame)()
|
||||
(frame<180 and back or pauseGame)()
|
||||
return
|
||||
end
|
||||
local m=setting.keyMap
|
||||
for p=1,players.human do
|
||||
@@ -651,24 +652,21 @@ local function widgetPress(W,x,y)
|
||||
VOICE("nya")
|
||||
elseif W.type=="switch"then
|
||||
W.code()
|
||||
W:FX()
|
||||
SFX("move",.6)
|
||||
elseif W.type=="slider"then
|
||||
if not x then return end
|
||||
local p=W.disp()
|
||||
W.code(x<W.x and 0 or x>W.x+W.w and W.unit or int((x-W.x)*W.unit/W.w+.5))
|
||||
if p==W.disp()then return end
|
||||
W:FX(p)
|
||||
local p,P=W.disp(),x<W.x and 0 or x>W.x+W.w and W.unit or int((x-W.x)*W.unit/W.w+.5)
|
||||
if p==P then return end
|
||||
W.code(P)
|
||||
if W.change then W.change()end
|
||||
end
|
||||
if W.hide and W.hide()then widget_sel=nil end
|
||||
end
|
||||
local function widgetDrag(W,x,y,dx,dy)
|
||||
if W.type=="slider"then
|
||||
local p=W.disp()
|
||||
W.code(x<W.x and 0 or x>W.x+W.w and W.unit or int((x-W.x)*W.unit/W.w+.5))
|
||||
if p==W.disp()then return end
|
||||
W:FX(p)
|
||||
local p,P=W.disp(),x<W.x and 0 or x>W.x+W.w and W.unit or int((x-W.x)*W.unit/W.w+.5)
|
||||
if p==P then return end
|
||||
W.code(P)
|
||||
if W.change then W.change()end
|
||||
elseif not W:isAbove(x,y)then
|
||||
widget_sel=nil
|
||||
@@ -685,18 +683,14 @@ local function widgetControl_key(i)
|
||||
if not scene.swapping and widget_sel then
|
||||
widgetPress(widget_sel)
|
||||
end
|
||||
else
|
||||
elseif i=="left"or i=="right"then
|
||||
if widget_sel then
|
||||
local W=widget_sel
|
||||
if W.type=="slider"then
|
||||
local p=W.disp()
|
||||
if i=="left"then
|
||||
if W.disp()>0 then W.code(W.disp()-1)end
|
||||
elseif i=="right"then
|
||||
if W.disp()<W.unit then W.code(W.disp()+1)end
|
||||
end
|
||||
if p==W.disp()then return end
|
||||
W:FX(p)
|
||||
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
|
||||
@@ -711,18 +705,19 @@ local function widgetControl_gamepad(i)
|
||||
end
|
||||
elseif i=="start"then
|
||||
if not scene.swapping and widget_sel then
|
||||
if not scene.swapping and widget_sel then
|
||||
widgetPress(widget_sel)
|
||||
end
|
||||
end
|
||||
elseif i=="dpleft"or i=="dpright"then
|
||||
if widget_sel then
|
||||
local W=widget_sel
|
||||
if W.hide and W.hide()then widget_sel=nil end
|
||||
if W.type=="button"then
|
||||
W.code()
|
||||
W:FX()
|
||||
SFX("button")
|
||||
VOICE("nya")
|
||||
elseif W.type=="switch"then
|
||||
W.code()
|
||||
W:FX()
|
||||
SFX("move",.6)
|
||||
-- elseif W.type=="slider"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
|
||||
@@ -957,44 +952,68 @@ function love.update(dt)
|
||||
scene.swapping=false
|
||||
end
|
||||
end
|
||||
if Tmr[scene.cur]then
|
||||
Tmr[scene.cur](dt)
|
||||
end
|
||||
local i=Tmr[scene.cur]
|
||||
if i then i(dt)end
|
||||
for i=#Task,1,-1 do
|
||||
local T=Task[i]
|
||||
if T.code(T.P,T.data)then
|
||||
rem(Task,i)
|
||||
end
|
||||
for i=i,#Task do
|
||||
Task[i]=Task[i+1]
|
||||
end
|
||||
end
|
||||
end
|
||||
for i=1,#voiceQueue do
|
||||
for i=#voiceQueue,1,-1 do
|
||||
local Q=voiceQueue[i]
|
||||
if #Q>0 then
|
||||
if type(Q[1])=="userdata"then
|
||||
if not Q[1]:isPlaying()then
|
||||
for i=1,#Q do
|
||||
Q[i]=Q[i+1]
|
||||
end
|
||||
end--放完了,pop出下一个
|
||||
else
|
||||
local n=1
|
||||
local L=voiceBank[Q[1]]
|
||||
while L[n]:isPlaying()do
|
||||
n=n+1
|
||||
if not L[n]then
|
||||
L[n]=L[n-1]:clone()
|
||||
L[n]:seek(0)
|
||||
break
|
||||
end
|
||||
if Q.s==0 then--闲置轨,自动删除多余
|
||||
if i>3 then
|
||||
local _=voiceQueue
|
||||
for i=i,#_ do
|
||||
_[i]=_[i+1]
|
||||
end
|
||||
Q[1]=L[n]
|
||||
Q[1]:setVolume(setting.voc*.1)
|
||||
Q[1]:play()
|
||||
--load voice with string
|
||||
end
|
||||
elseif Q.s==1 then--等待转换
|
||||
Q[1]=getVoice(Q[1])
|
||||
Q[1]:setVolume(setting.voc*.1)
|
||||
Q[1]:play()
|
||||
Q.s=Q[2]and 2 or 4
|
||||
elseif Q.s==2 then--播放1,等待2
|
||||
if Q[1]:getDuration()-Q[1]:tell()<.08 then
|
||||
Q[2]=getVoice(Q[2])
|
||||
Q[2]:setVolume(setting.voc*.1)
|
||||
Q[2]:play()
|
||||
Q.s=3
|
||||
end
|
||||
elseif Q.s==3 then--12同时播放
|
||||
if not Q[1]:isPlaying()then
|
||||
for i=1,#Q do
|
||||
Q[i]=Q[i+1]
|
||||
end
|
||||
Q.s=Q[2]and 2 or 4
|
||||
end
|
||||
elseif Q.s==4 then--最后播放
|
||||
if not Q[1]:isPlaying()then
|
||||
Q[1]=nil
|
||||
Q.s=0
|
||||
end
|
||||
end
|
||||
if #Q>0 then
|
||||
if Q[1]:isPlaying()then
|
||||
if Q[2]and type(Q[2])=="string"and Q[1]:getDuration()-Q[1]:tell()<.08 then
|
||||
Q[2]=getVoice(Q[2])
|
||||
end
|
||||
--快放完了,播放下一个
|
||||
else
|
||||
for i=1,#Q do
|
||||
Q[i]=Q[i+1]
|
||||
end
|
||||
--放完了,移除
|
||||
end
|
||||
else
|
||||
end
|
||||
end
|
||||
-- for k,W in next,Widget[scene.cur]do
|
||||
-- end--更新控件
|
||||
for k,W in next,Widget[scene.cur]do
|
||||
W:update()
|
||||
end--更新控件
|
||||
end
|
||||
local scs={1,2,1,2,1,2,1,2,1,2,1.5,1.5,.5,2.5}
|
||||
local FPS=love.timer.getFPS
|
||||
|
||||
@@ -1803,7 +1803,7 @@ function player.drop(P)--Place piece
|
||||
end
|
||||
send=send+(renATK[P.combo]or 3)
|
||||
if #P.field==0 then
|
||||
P:showText(text.PC,0,-80,60,"flicker")
|
||||
P:showText(text.PC,0,-80,50,"flicker")
|
||||
send=min(send,3)+min(6+P.stat.pc,10)
|
||||
exblock=exblock+2
|
||||
sendTime=sendTime+60
|
||||
|
||||
27
sound.lua
27
sound.lua
@@ -31,22 +31,39 @@ function SFX(s,v,pos)
|
||||
S:play()
|
||||
end
|
||||
end
|
||||
function getVoice(str)
|
||||
local n=1
|
||||
local L=voiceBank[str]
|
||||
while L[n]:isPlaying()do
|
||||
n=n+1
|
||||
if not L[n]then
|
||||
L[n]=L[n-1]:clone()
|
||||
L[n]:seek(0)
|
||||
break
|
||||
end
|
||||
end
|
||||
return L[n]
|
||||
--load voice with string
|
||||
end
|
||||
function getFreeVoiceChannel()
|
||||
local i=#voiceQueue
|
||||
for i=1,i do
|
||||
if #voiceQueue[i]==0 then return i end
|
||||
end
|
||||
voiceQueue[i+1]={}
|
||||
voiceQueue[i+1]={s=0}
|
||||
return i+1
|
||||
end
|
||||
function VOICE(s,chn)
|
||||
if setting.voc>0 then
|
||||
if chn then
|
||||
voiceQueue[chn][#voiceQueue[chn]+1]=voiceList[s][rnd(#voiceList[s])]
|
||||
--添加到[chn]
|
||||
local L=voiceQueue[chn]
|
||||
local _=voiceList[s]
|
||||
L[#L+1]=_[rnd(#_)]
|
||||
L.s=1
|
||||
--添加到queue[chn]
|
||||
else
|
||||
voiceQueue[getFreeVoiceChannel()]={voiceList[s][rnd(#voiceList[s])]}
|
||||
--自动查找/创建空轨
|
||||
voiceQueue[getFreeVoiceChannel()]={s=1,voiceList[s][rnd(#voiceList[s])]}
|
||||
--自动创建空轨/播放
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -8,18 +8,19 @@ Patron(rmb10+):
|
||||
zxc
|
||||
?[D*a]
|
||||
Future outlook:
|
||||
New mode system with:
|
||||
ultra mode
|
||||
rythem mode
|
||||
combo mode
|
||||
bigbang mode
|
||||
TTT mode
|
||||
Normal:
|
||||
timing mode
|
||||
powerinfo switch
|
||||
splashing block
|
||||
ajustable next count
|
||||
custom block color/direction
|
||||
new mode system
|
||||
combo mode
|
||||
bigbang mode
|
||||
TTT mode
|
||||
custom block sequence
|
||||
CC smarter(think of gaebage buffer)
|
||||
CC smarter(think of garbage buffer)
|
||||
game recording
|
||||
new AI:task-Z
|
||||
auto GUI in any screen size
|
||||
@@ -28,6 +29,11 @@ Future outlook:
|
||||
infinite 1v1
|
||||
square mode
|
||||
more FXs & 3d features & animations
|
||||
0.8.4:
|
||||
better widget performence
|
||||
vocal more natural(important,may cause new bug)
|
||||
a bit better performence on mobile devices
|
||||
fatal bug fixed
|
||||
0.8.3:
|
||||
new widget appearence
|
||||
cuter miya
|
||||
|
||||
Reference in New Issue
Block a user