Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f29fc7081a | ||
|
|
882b841d3f | ||
|
|
3d22f5d8ca | ||
|
|
a3302ab2bc | ||
|
|
cdd5194108 | ||
|
|
40de030cae | ||
|
|
e1d92a166b | ||
|
|
99b55b72e0 | ||
|
|
08883b952f | ||
|
|
76fab86692 | ||
|
|
725eb4e26f | ||
|
|
486a64cca3 | ||
|
|
8e5f6f8b7c | ||
|
|
c0149d5830 | ||
|
|
28d5136e95 | ||
|
|
2768fa748b |
BIN
BGM/far.ogg
Normal file
BIN
BGM/far.ogg
Normal file
Binary file not shown.
BIN
BGM/how feeling.ogg
Normal file
BIN
BGM/how feeling.ogg
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
303
Zframework/bg.lua
Normal file
303
Zframework/bg.lua
Normal file
@@ -0,0 +1,303 @@
|
||||
local gc=love.graphics
|
||||
local int,ceil,rnd,abs=math.floor,math.ceil,math.random,math.abs
|
||||
local max,min,sin,cos=math.max,math.min,math.sin,math.cos
|
||||
|
||||
local BG
|
||||
local scr=scr
|
||||
local BGvars={_G=_G,SHADER=SHADER}
|
||||
|
||||
local back={}
|
||||
back.none={
|
||||
draw=function()
|
||||
gc.clear(.15,.15,.15)
|
||||
end,
|
||||
}
|
||||
back.grey={
|
||||
draw=function()
|
||||
gc.clear(.3,.3,.3)
|
||||
end,
|
||||
}
|
||||
back.glow={
|
||||
init=function()
|
||||
t=0
|
||||
end,
|
||||
update=function(dt)
|
||||
t=t+dt
|
||||
end,
|
||||
draw=function()
|
||||
local t=(sin(t*.5)+sin(t*.7)+sin(t*.9+1)+sin(t*1.5)+sin(t*2+10))*.08
|
||||
gc.clear(t,t,t)
|
||||
end,
|
||||
}--light-dark
|
||||
back.rgb={
|
||||
init=function()
|
||||
t=0
|
||||
end,
|
||||
update=function(dt)
|
||||
t=t+dt
|
||||
end,
|
||||
draw=function()
|
||||
gc.clear(
|
||||
sin(t*1.2)*.15+.2,
|
||||
sin(t*1.5)*.15+.2,
|
||||
sin(t*1.9)*.15+.2
|
||||
)
|
||||
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
|
||||
end,
|
||||
update=function(dt)
|
||||
t=t+dt
|
||||
end,
|
||||
draw=function()
|
||||
local t=.13-t%3%1.7
|
||||
if t<.2 then gc.clear(t,t,t)
|
||||
else gc.clear(0,0,0)
|
||||
end
|
||||
end,
|
||||
}--flash after random time
|
||||
back.aura={
|
||||
init=function()
|
||||
t=rnd()*3600
|
||||
BG.resize(scr.w,scr.h)
|
||||
end,
|
||||
resize=function(w,h)
|
||||
SHADER.aura:send("w",w*scr.dpi)
|
||||
SHADER.aura:send("h",h*scr.dpi)
|
||||
end,
|
||||
update=function(dt)
|
||||
t=t+dt
|
||||
end,
|
||||
draw=function()
|
||||
SHADER.aura:send("t",t)
|
||||
gc.setShader(SHADER.aura)
|
||||
gc.rectangle("fill",0,0,scr.w,scr.h)
|
||||
gc.setShader()
|
||||
end,
|
||||
}--cool liquid background
|
||||
back.game1={
|
||||
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)
|
||||
end,
|
||||
update=function(dt)
|
||||
t=t+dt
|
||||
end,
|
||||
draw=function()
|
||||
SHADER.rainbow:send("t",t)
|
||||
gc.setColor(.6,.6,.6)
|
||||
gc.setShader(SHADER.rainbow)
|
||||
gc.rectangle("fill",0,0,scr.w,scr.h)
|
||||
gc.setShader()
|
||||
end,
|
||||
}--Rolling rainbow
|
||||
back.game2={
|
||||
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)
|
||||
end,
|
||||
update=function(dt)
|
||||
t=t+dt
|
||||
end,
|
||||
draw=function()
|
||||
SHADER.rainbow:send("t",t)
|
||||
gc.setColor(.7,.4,.4)
|
||||
gc.setShader(SHADER.rainbow)
|
||||
gc.rectangle("fill",0,0,scr.w,scr.h)
|
||||
gc.setShader()
|
||||
end,
|
||||
}--Red rolling rainbow
|
||||
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)
|
||||
end,
|
||||
update=function(dt)
|
||||
t=t+dt
|
||||
end,
|
||||
draw=function()
|
||||
SHADER.rainbow:send("t",t)
|
||||
gc.setColor(.5,.5,.8)
|
||||
gc.setShader(SHADER.rainbow)
|
||||
gc.rectangle("fill",0,0,scr.w,scr.h)
|
||||
gc.setShader()
|
||||
end,
|
||||
}--Blue rolling rainbow
|
||||
back.game4={
|
||||
init=function()
|
||||
t=0
|
||||
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)
|
||||
gc.rectangle("fill",0,0,scr.w,scr.h)
|
||||
gc.setShader()
|
||||
end,
|
||||
}--Blue strap
|
||||
back.game5={
|
||||
init=function()
|
||||
t=0
|
||||
end,
|
||||
update=function(dt)
|
||||
t=t+dt
|
||||
end,
|
||||
draw=function()
|
||||
local t=2.5-t%20%6%2.5
|
||||
if t<.3 then gc.clear(t,t,t)
|
||||
else gc.clear(0,0,0)
|
||||
end
|
||||
end,
|
||||
}--Lightning
|
||||
|
||||
local blocks=require("parts/mino")
|
||||
local scs=require("parts/spinCenters")
|
||||
back.game6={
|
||||
init=function()
|
||||
t=0
|
||||
colorLib=_G.SKIN.libColor
|
||||
colorSet=_G.setting.skin
|
||||
miniBlock=_G.miniBlock
|
||||
end,
|
||||
update=function(dt)
|
||||
t=t+dt
|
||||
end,
|
||||
draw=function()
|
||||
local t=1.2-t%10%3%1.2
|
||||
if t<.3 then gc.clear(t,t,t)
|
||||
else gc.clear(0,0,0)
|
||||
end
|
||||
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)
|
||||
end,
|
||||
}--Fast lightning + spining tetromino
|
||||
|
||||
local matrixT={}for i=1,50 do matrixT[i]={}for j=1,50 do matrixT[i][j]=love.math.noise(i,j)+2 end end
|
||||
back.matrix={
|
||||
init=function()
|
||||
t=rnd()*3600
|
||||
end,
|
||||
update=function(dt)
|
||||
t=t+dt
|
||||
end,
|
||||
draw=function()
|
||||
gc.scale(scr.k)
|
||||
gc.clear(.15,.15,.15)
|
||||
local Y=ceil(scr.h*scr.dpi/80)
|
||||
for x=1,ceil(scr.w*scr.dpi/80)do
|
||||
for y=1,Y do
|
||||
gc.setColor(1,1,1,sin(x+matrixT[x][y]*t)*.1+.1)
|
||||
gc.rectangle("fill",80*x,80*y,-80,-80)
|
||||
end
|
||||
end
|
||||
gc.scale(1/scr.k)
|
||||
end,
|
||||
}
|
||||
|
||||
back.space={
|
||||
init=function()
|
||||
stars={}
|
||||
W,H=scr.w+20,scr.h+20
|
||||
BG.resize(scr.w,scr.h)
|
||||
end,
|
||||
resize=function(w,h)
|
||||
local S=stars
|
||||
for i=1,1260,5 do
|
||||
local s=rnd(26,40)*.1
|
||||
S[i]=s*scr.k --size
|
||||
S[i+1]=rnd(W)-10 --x
|
||||
S[i+2]=rnd(H)-10 --y
|
||||
S[i+3]=(rnd()-.5)*.01*s --vx
|
||||
S[i+4]=(rnd()-.5)*.01*s --vy
|
||||
end--800 var
|
||||
end,
|
||||
update=function(dt)
|
||||
local S=stars
|
||||
for i=1,1260,5 do
|
||||
S[i+1]=(S[i+1]+S[i+3])%W
|
||||
S[i+2]=(S[i+2]+S[i+4])%H
|
||||
end--star moving
|
||||
end,
|
||||
draw=function()
|
||||
gc.clear(.2,.2,.2)
|
||||
if not stars[1]then return end
|
||||
gc.translate(-10,-10)
|
||||
gc.setColor(.8,.8,.8)
|
||||
for i=1,1260,5 do
|
||||
local s=stars
|
||||
local x,y=s[i+1],s[i+2]
|
||||
s=s[i]
|
||||
gc.rectangle("fill",x,y,s,s)
|
||||
end
|
||||
gc.translate(10,10)
|
||||
end,
|
||||
discard=function()
|
||||
stars={}
|
||||
end,
|
||||
}
|
||||
|
||||
for _,bg in next,back do
|
||||
if not bg.init then bg.init= NULL end setfenv(bg.init ,BGvars)
|
||||
if not bg.resize then bg.resize= NULL end setfenv(bg.resize ,BGvars)
|
||||
if not bg.update then bg.update= NULL end setfenv(bg.update ,BGvars)
|
||||
if not bg.discard then bg.discard=NULL end setfenv(bg.discard ,BGvars)
|
||||
if not bg.draw then bg.draw= NULL end setfenv(bg.draw ,BGvars)
|
||||
end--make BG vars invisible
|
||||
|
||||
BG={
|
||||
cur="none",
|
||||
resize=NULL,
|
||||
update=NULL,
|
||||
draw=back.none.draw,
|
||||
}
|
||||
function BG.set(bg)
|
||||
if bg==BG.cur or not setting.bg then return end
|
||||
if BG.discard then
|
||||
BG.discard()
|
||||
collectgarbage()
|
||||
end
|
||||
BG.cur=bg
|
||||
bg=back[bg]
|
||||
|
||||
BG.init=bg.init or NULL
|
||||
BG.resize=bg.resize or NULL
|
||||
BG.update=bg.update or NULL
|
||||
BG.discard=bg.discard or NULL
|
||||
BG.draw=bg.draw or NULL
|
||||
BG.init()
|
||||
end
|
||||
return BG
|
||||
89
Zframework/bgm.lua
Normal file
89
Zframework/bgm.lua
Normal file
@@ -0,0 +1,89 @@
|
||||
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]
|
||||
--playing=[src:playing SRC]
|
||||
}
|
||||
BGM.list={
|
||||
"blank","way","race","newera","push","reason","infinite",
|
||||
"secret7th","secret8th",
|
||||
"shining terminal","oxygen","distortion","far",
|
||||
"rockblock","cruelty","final","8-bit happiness","end",
|
||||
"how feeling",
|
||||
}
|
||||
BGM.len=#BGM.list
|
||||
function BGM.loadOne(N)
|
||||
N=BGM.list[N]
|
||||
local file="/BGM/"..N..".ogg"
|
||||
if love.filesystem.getInfo(file)then
|
||||
BGM.list[N]=love.audio.newSource(file,"stream")
|
||||
BGM.list[N]:setLooping(true)
|
||||
BGM.list[N]:setVolume(0)
|
||||
end
|
||||
end
|
||||
function BGM.loadAll()
|
||||
for i=1,#BGM.list do
|
||||
BGM.loadOne(i)
|
||||
end
|
||||
end
|
||||
function BGM.play(s)
|
||||
if setting.bgm==0 then
|
||||
BGM.playing=BGM.list[s]
|
||||
BGM.suspend,BGM.nowPlay=s
|
||||
return
|
||||
elseif not s or not BGM.list[s]then
|
||||
return
|
||||
end
|
||||
if BGM.nowPlay~=s then
|
||||
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(fadeIn,s)
|
||||
BGM.playing=BGM.list[s]
|
||||
BGM.playing:play()
|
||||
end
|
||||
end
|
||||
function BGM.freshVolume()
|
||||
if BGM.playing then
|
||||
local v=setting.bgm*.1
|
||||
if v>0 then
|
||||
BGM.playing:setVolume(v)
|
||||
if BGM.suspend then
|
||||
BGM.playing:play()
|
||||
BGM.nowPlay,BGM.suspend=BGM.suspend
|
||||
end
|
||||
else
|
||||
BGM.playing:setVolume(0)
|
||||
BGM.playing:pause()
|
||||
BGM.suspend,BGM.nowPlay=BGM.nowPlay
|
||||
end
|
||||
end
|
||||
end
|
||||
function BGM.stop()
|
||||
if BGM.nowPlay then
|
||||
TASK.new(fadeOut,BGM.nowPlay)
|
||||
end
|
||||
TASK.changeCode(fadeIn,fadeOut)
|
||||
BGM.playing,BGM.nowPlay=nil
|
||||
end
|
||||
return BGM
|
||||
@@ -15,7 +15,7 @@ local function splitS(s,sep)
|
||||
return t
|
||||
end
|
||||
local tabs={
|
||||
[0]="",
|
||||
[0]="",
|
||||
"\t",
|
||||
"\t\t",
|
||||
"\t\t\t",
|
||||
@@ -39,16 +39,21 @@ 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 error("Error key type!")
|
||||
else assert(false,"Error key 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,t+1)
|
||||
elseif T=="boolean"then v=tostring(v)
|
||||
else error("Error data type!")
|
||||
else assert(false,"Error data type!")
|
||||
end
|
||||
s=s..tabs[t]..k..v..",\n"
|
||||
end
|
||||
@@ -68,7 +73,7 @@ end
|
||||
|
||||
local files={
|
||||
data= fs.newFile("data.dat"),
|
||||
setting=fs.newFile("setting.dat"),
|
||||
setting=fs.newFile("settings.dat"),
|
||||
VK= fs.newFile("virtualkey.dat"),
|
||||
keyMap= fs.newFile("key.dat"),
|
||||
unlock= fs.newFile("unlock.dat"),
|
||||
@@ -136,54 +141,6 @@ function File.loadData()
|
||||
if s then
|
||||
setfenv(s,{})
|
||||
local S=s()
|
||||
if S.version~=gameVersion then
|
||||
S.version=gameVersion
|
||||
TEXT.show(text.newVersion,640,200,30,"fly",.3)
|
||||
end
|
||||
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
|
||||
addToTable(S,stat)
|
||||
end
|
||||
end
|
||||
@@ -1,4 +1,5 @@
|
||||
local IMG={
|
||||
batteryImage="/mess/power.png",
|
||||
titleImage="mess/title.png",
|
||||
coloredTitleImage="mess/title_colored.png",
|
||||
dialCircle="mess/dialCircle.png",
|
||||
@@ -16,8 +17,7 @@ local IMG={
|
||||
miyaF3="miya/f3.png",
|
||||
miyaF4="miya/f4.png",
|
||||
|
||||
gameBG1="BG/bg1.png",
|
||||
gameBG2="BG/bg2.png",
|
||||
electric="mess/electric.png",
|
||||
}
|
||||
local list={}
|
||||
local count=0
|
||||
1096
Zframework/init.lua
Normal file
1096
Zframework/init.lua
Normal file
File diff suppressed because it is too large
Load Diff
1814
Zframework/languages.lua
Normal file
1814
Zframework/languages.lua
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,10 @@
|
||||
--LIGHT MODULE(Optimized by MrZ,Original on github/love2d community/simple-love-lights)
|
||||
--Heavily based on mattdesl's libGDX implementation:
|
||||
--https://github.com/mattdesl/lwjgl-basics/wiki/2D-Pixel-Perfect-Shadows
|
||||
--Private--
|
||||
local gc=love.graphics
|
||||
local C=gc.clear
|
||||
local shadowMapShader=gc.newShader("shader/shadowMap.cs")--Shader for caculating the 1D shadow map.
|
||||
local lightRenderShader=gc.newShader("shader/lightRender.cs")--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
|
||||
@@ -19,62 +18,72 @@ local function destroy(L)
|
||||
L.renderCanvas:release()
|
||||
end
|
||||
local function draw(L)
|
||||
--Initialization
|
||||
local r,g,b,a=love.graphics.getColor()
|
||||
gc.setCanvas(L.blackCanvas)C()
|
||||
gc.setCanvas(L.shadowCanvas)C()
|
||||
gc.setCanvas(L.renderCanvas)C()
|
||||
lightRenderShader:send("xresolution",L.size);
|
||||
shadowMapShader:send("yresolution",L.size);
|
||||
--初始化数据
|
||||
|
||||
--get up-left of light
|
||||
local X=L.x-L.size*.5
|
||||
local Y=L.y-L.size*.5
|
||||
--整束光的左上角
|
||||
|
||||
--Render solid
|
||||
gc.translate(-X,-Y)
|
||||
L.blackCanvas:renderTo(L.blackFn)
|
||||
gc.translate(X,Y)
|
||||
--渲染遮光物
|
||||
|
||||
--Render shade canvas by solid
|
||||
gc.setShader(shadowMapShader)
|
||||
gc.setCanvas(L.shadowCanvas)
|
||||
gc.draw(L.blackCanvas)
|
||||
--根据遮光物渲染阴影画布
|
||||
|
||||
--Render light canvas by shade
|
||||
gc.setShader(lightRenderShader)
|
||||
gc.setCanvas(L.renderCanvas)
|
||||
gc.draw(L.shadowCanvas,0,0,0,1,L.size)
|
||||
--根据阴影画布渲染光画布
|
||||
|
||||
--Ready to final render
|
||||
gc.setShader()gc.setCanvas()gc.setBlendMode("add")
|
||||
--准备渲染
|
||||
|
||||
--Render to screes
|
||||
gc.setColor(r,g,b,a)
|
||||
gc.draw(L.renderCanvas,X,Y+L.size,0,1,-1)
|
||||
--渲染到屏幕
|
||||
|
||||
--Reset
|
||||
gc.setBlendMode("alpha")
|
||||
--复位
|
||||
end
|
||||
--Public--
|
||||
function Lights.draw()
|
||||
|
||||
local LIGHT={}
|
||||
function LIGHT.draw()
|
||||
for i=1,#Lights do
|
||||
Lights[i]:draw()
|
||||
end
|
||||
end
|
||||
function Lights.clear(L)
|
||||
function LIGHT.clear(L)
|
||||
for i=#Lights,1,-1 do
|
||||
Lights[i]:destroy()
|
||||
Lights[i]=nil
|
||||
end
|
||||
end
|
||||
function Lights.add(x,y,R,F)
|
||||
function LIGHT.add(x,y,R,F)
|
||||
local id=#Lights+1
|
||||
Lights[id]={
|
||||
--Methods
|
||||
id=id,
|
||||
x=x,y=y,size=R,
|
||||
blackCanvas=gc.newCanvas(R,R),--遮挡物画布
|
||||
shadowCanvas=gc.newCanvas(R,1),--1D视深画布
|
||||
renderCanvas=gc.newCanvas(R,R),--灯光画布
|
||||
blackFn=F,--遮挡物绘图函数
|
||||
--方法
|
||||
blackCanvas=gc.newCanvas(R,R),--solid canvas
|
||||
shadowCanvas=gc.newCanvas(R,1),--1D vis-depth canvas
|
||||
renderCanvas=gc.newCanvas(R,R),--light canvas
|
||||
blackFn=F,--solid draw funcion
|
||||
|
||||
|
||||
move=move,
|
||||
setPow=setPow,
|
||||
draw=draw,
|
||||
destroy=destroy,
|
||||
}
|
||||
end
|
||||
return Lights
|
||||
return LIGHT
|
||||
@@ -17,7 +17,7 @@ local modeRankColor={
|
||||
color.purple, --Special
|
||||
}
|
||||
local rankString={
|
||||
"C","B","A","S","SS",
|
||||
"D","C","B","A","S",
|
||||
}
|
||||
local miniTitle_rect={
|
||||
{2,0,5,1},{4,1,1,6},
|
||||
@@ -54,7 +54,7 @@ local function VirtualkeyPreview()
|
||||
local c=sceneTemp.sel==i and .6 or 1
|
||||
gc.setColor(c,1,c,setting.VKAlpha*.1)
|
||||
gc.setLineWidth(B.r*.07)
|
||||
gc.circle("line",B.x,B.y,B.r)
|
||||
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
|
||||
end
|
||||
end
|
||||
@@ -70,13 +70,13 @@ local function drawVirtualkey()
|
||||
local B=V[i]
|
||||
gc.setColor(1,1,1,a)
|
||||
gc.setLineWidth(B.r*.07)
|
||||
gc.circle("line",B.x,B.y,B.r)--Button outline
|
||||
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
|
||||
if _>0 then
|
||||
gc.setColor(1,1,1,a*_*.08)
|
||||
gc.circle("fill",B.x,B.y,B.r*.94)--Glow
|
||||
gc.circle("line",B.x,B.y,B.r*(1.4-_*.04))--Ripple
|
||||
gc.circle("fill",B.x,B.y,B.r*.94,10)--Glow
|
||||
gc.circle("line",B.x,B.y,B.r*(1.4-_*.04),10)--Ripple
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -86,12 +86,12 @@ local function drawVirtualkey()
|
||||
local B=V[i]
|
||||
gc.setColor(1,1,1,a)
|
||||
gc.setLineWidth(B.r*.07)
|
||||
gc.circle("line",B.x,B.y,B.r)
|
||||
gc.circle("line",B.x,B.y,B.r,10)
|
||||
_=V[i].pressTime
|
||||
if _>0 then
|
||||
gc.setColor(1,1,1,a*_*.08)
|
||||
gc.circle("fill",B.x,B.y,B.r*.94)
|
||||
gc.circle("line",B.x,B.y,B.r*(1.4-_*.04))
|
||||
gc.circle("fill",B.x,B.y,B.r*.94,10)
|
||||
gc.circle("line",B.x,B.y,B.r*(1.4-_*.04),10)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -152,61 +152,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()*1.26+M.id),12.6*sin(Timer()+M.id)
|
||||
gc.setColor(0,0,0,.5)
|
||||
mDraw(_,M.x+dx*1.5,M.y+dy*1.5)
|
||||
gc.setColor(1,1,1,.8)
|
||||
mDraw(_,M.x+dx,M.y+dy)
|
||||
name=drawableText[rankString[R[M.name]]]
|
||||
if name then
|
||||
gc.setColor(0,0,0,.26)
|
||||
mDraw(name,M.x,M.y)
|
||||
end
|
||||
--[[
|
||||
if M.icon then
|
||||
@@ -226,7 +225,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
|
||||
@@ -278,8 +277,8 @@ function Pnt.music()
|
||||
gc.draw(drawableText.musicRoom,22,23)
|
||||
gc.draw(drawableText.nowPlaying,490,390)
|
||||
setFont(30)
|
||||
for i=1,#musicID do
|
||||
gc.print(musicID[i],50,90+30*i)
|
||||
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)
|
||||
if BGM.nowPlay then
|
||||
@@ -295,21 +294,59 @@ function Pnt.music()
|
||||
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=miniBlock
|
||||
local x,y=120,126
|
||||
local cx,cy=120,126
|
||||
for i=1,len do
|
||||
local B=miniBlock[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)
|
||||
@@ -335,10 +372,12 @@ 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)
|
||||
gc.setColor(skin.libColor[pen])
|
||||
gc.setColor(SKIN.libColor[pen])
|
||||
gc.rectangle("line",565,460,70,70)
|
||||
elseif pen==-1 then
|
||||
gc.setLineWidth(5)
|
||||
@@ -346,19 +385,32 @@ 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
|
||||
_=setting.skin[i]
|
||||
gc.setColor(skin.libColor[_])
|
||||
gc.setColor(SKIN.libColor[_])
|
||||
mStr(text.block[i],500+65*_,65)
|
||||
end
|
||||
end
|
||||
function Pnt.play()
|
||||
if marking then
|
||||
setFont(26)
|
||||
local x=Timer()*46%1680-200
|
||||
gc.setColor(1,1,1,abs(.26*(1-x/640)))
|
||||
mStr(text.marking,x,260+62*sin(Timer()))
|
||||
-- gc.setColor(1,1,1,.0626)
|
||||
-- mStr(text.marking,260,62+26*sin(Timer()))
|
||||
-- mStr(text.marking,1100,460+62*sin(Timer()*1.2))
|
||||
end
|
||||
for p=1,#players do
|
||||
players[p]:draw()
|
||||
end
|
||||
@@ -416,13 +468,27 @@ 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.push("transform")
|
||||
gc.origin()
|
||||
gc.rectangle("fill",0,0,scr.w,scr.h)
|
||||
gc.pop()
|
||||
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)
|
||||
SHADER.warning:send("level",game.warnLVL)
|
||||
gc.setShader(SHADER.warning)
|
||||
gc.rectangle("fill",0,0,scr.w,scr.h)
|
||||
gc.setShader()
|
||||
end
|
||||
gc.pop()
|
||||
end
|
||||
local hexList={1,0,.5,1.732*.5,-.5,1.732*.5}for i=1,6 do hexList[i]=hexList[i]*150 end
|
||||
local textPos={90,131,-90,131,-200,-25,-90,-181,90,-181,200,-25}
|
||||
@@ -431,21 +497,21 @@ local dataPos={90,143,-90,143,-200,-13,-90,-169,90,-169,200,-13}
|
||||
function Pnt.pause()
|
||||
local S=sceneTemp
|
||||
local T=S.timer*.02
|
||||
if T<1 or gameResult then Pnt.play()end
|
||||
if T<1 or game.result then Pnt.play()end
|
||||
--Dark BG
|
||||
local _=T
|
||||
if gameResult then _=_*.6 end
|
||||
if game.result then _=_*.7 end
|
||||
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
|
||||
setFont(25)
|
||||
if pauseCount>0 then
|
||||
if game.pauseCount>0 then
|
||||
gc.setColor(1,.4,.4,T)
|
||||
gc.print(text.pauseCount..":["..pauseCount.."] "..format("%.2f",pauseTime).."s",70,100)
|
||||
gc.print(text.pauseCount..":["..game.pauseCount.."] "..format("%.2f",game.pauseTime).."s",70,100)
|
||||
end
|
||||
|
||||
gc.setColor(1,1,1,T)
|
||||
@@ -457,10 +523,10 @@ function Pnt.pause()
|
||||
|
||||
--Result Text
|
||||
setFont(35)
|
||||
mText(gameResult and drawableText[gameResult]or drawableText.pause,640,50-10*(5-sceneTemp.timer*.1)^1.5)
|
||||
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
|
||||
@@ -470,7 +536,7 @@ function Pnt.pause()
|
||||
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")
|
||||
@@ -515,9 +581,9 @@ function Pnt.setting_game()
|
||||
mText(drawableText.setting_game,640,15)
|
||||
gc.draw(blockSkin[int(Timer()*2)%11+1],720,540,Timer()%6.28319,2,nil,15,15)
|
||||
end
|
||||
function Pnt.setting_graphic()
|
||||
function Pnt.setting_video()
|
||||
gc.setColor(1,1,1)
|
||||
mText(drawableText.setting_graphic,640,15)
|
||||
mText(drawableText.setting_video,640,15)
|
||||
end
|
||||
function Pnt.setting_sound()
|
||||
gc.setColor(1,1,1,.8)
|
||||
@@ -598,16 +664,16 @@ function Pnt.setting_key()
|
||||
|
||||
gc.setColor(1,1,1)
|
||||
setFont(26)
|
||||
local board=s.board
|
||||
local b1,b2=keyMap[s.board],keyMap[s.board+2]
|
||||
for N=1,20 do
|
||||
if N<11 then
|
||||
gc.printf(text.acts[N],47,45*N+22,180,"right")
|
||||
mStr(keyMap[board][N],340,45*N+22)
|
||||
mStr(keyMap[board+8][N],540,45*N+22)
|
||||
mStr(b1[N],340,45*N+22)
|
||||
mStr(b2[N],540,45*N+22)
|
||||
else
|
||||
gc.printf(text.acts[N],647,45*N-428,180,"right")
|
||||
mStr(keyMap[board][N],940,45*N-428)
|
||||
mStr(keyMap[board+8][N],1040,45*N-428)
|
||||
mStr(b1[N],940,45*N-428)
|
||||
mStr(b2[N],1040,45*N-428)
|
||||
end
|
||||
end
|
||||
gc.setLineWidth(2)
|
||||
@@ -618,9 +684,7 @@ function Pnt.setting_key()
|
||||
gc.line(40,y,1240,y)
|
||||
end
|
||||
setFont(35)
|
||||
gc.print("Player:",170,590)
|
||||
gc.print(int(board*.5+.5),300,590)
|
||||
gc.print(board.."/8",580,590)
|
||||
gc.print(text.page..s.board,280,590)
|
||||
gc.draw(drawableText.ctrlSetHelp,50,650)
|
||||
end
|
||||
function Pnt.setting_skin()
|
||||
@@ -669,11 +733,11 @@ function Pnt.help()
|
||||
setFont(20)
|
||||
gc.setColor(1,1,1)
|
||||
for i=1,#text.help do
|
||||
gc.printf(text.help[i],150,30*i-10,1000,"center")
|
||||
gc.printf(text.help[i],150,35*i+40,1000,"center")
|
||||
end
|
||||
setFont(19)
|
||||
gc.print(text.used,30,330)
|
||||
gc.draw(IMG.titleImage,280,610,.1,1+.05*sin(Timer()*2),nil,206,35)
|
||||
gc.draw(IMG.titleImage,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)
|
||||
@@ -681,15 +745,30 @@ function Pnt.help()
|
||||
gc.draw(IMG.pay2,1014,20)
|
||||
setFont(20)
|
||||
mStr(text.group,640,490)
|
||||
gc.setColor(1,1,1,sin(Timer()*10)*.4+.6)
|
||||
gc.setColor(1,1,1,sin(Timer()*20)*.3+.6)
|
||||
setFont(30)
|
||||
gc.print(text.support,150,283+20,sin(Timer()*2.6)*.02,nil,nil,115,20)
|
||||
gc.print(text.support,1138,270+20,sin(Timer()*2.83)*.02,nil,nil,115,20)
|
||||
mStr(text.support,150+sin(Timer()*4)*20,283)
|
||||
mStr(text.support,1138-sin(Timer()*4)*20,270)
|
||||
end
|
||||
function Pnt.staff()
|
||||
local L=text.staff
|
||||
local t=sceneTemp.time
|
||||
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)
|
||||
end
|
||||
end
|
||||
function Pnt.stat()
|
||||
local chart=sceneTemp.chart
|
||||
setFont(24)
|
||||
local _,__=skin.libColor,setting.skin
|
||||
local _,__=SKIN.libColor,setting.skin
|
||||
local A,B=chart.A1,chart.A2
|
||||
for x=1,7 do
|
||||
gc.setColor(_[__[x]])
|
||||
@@ -737,8 +816,6 @@ function Pnt.history()
|
||||
gc.rectangle("line",30,45,1000,632)
|
||||
setFont(20)
|
||||
local _=sceneTemp
|
||||
for i=0,min(22,#_[1]-_[2])do
|
||||
gc.print(_[1][_[2]+i],40,50+27*(i))
|
||||
end
|
||||
gc.print(_[1][_[2]],40,50)
|
||||
end
|
||||
return Pnt
|
||||
347
Zframework/scene.lua
Normal file
347
Zframework/scene.lua
Normal file
@@ -0,0 +1,347 @@
|
||||
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 scr=scr
|
||||
local SCN={
|
||||
cur="load",--Current scene
|
||||
swapping=false,--ifSwapping
|
||||
swap={
|
||||
tar=nil, --Swapping target
|
||||
style=nil, --Swapping style
|
||||
mid=nil, --Loading point
|
||||
time=nil, --Full swap time
|
||||
draw=nil, --Swap draw func
|
||||
},
|
||||
seq={"quit","slowFade"},--Back sequence
|
||||
}--scene datas,returned
|
||||
|
||||
local sceneInit={}
|
||||
sceneInit.quit=love.event.quit
|
||||
function sceneInit.load()
|
||||
sceneTemp={
|
||||
phase=1,--Loading stage
|
||||
cur=1,--Counter
|
||||
tar=#VOC.name,--Loading bar lenth(current)
|
||||
tip=require("parts/getTip"),
|
||||
list={
|
||||
#VOC.name,
|
||||
#BGM.list,
|
||||
#SFX.list,
|
||||
IMG.getCount(),
|
||||
#Modes,
|
||||
1,
|
||||
},
|
||||
skip=false,--if skipping
|
||||
}
|
||||
end
|
||||
function sceneInit.intro()
|
||||
BG.set("space")
|
||||
sceneTemp=0--animation timer
|
||||
BGM.play("blank")
|
||||
end
|
||||
function sceneInit.main()
|
||||
BG.set("space")
|
||||
BGM.play("blank")
|
||||
destroyPlayers()
|
||||
modeEnv={}
|
||||
if not players[1]then
|
||||
PLY.newDemoPlayer(1,900,35,1.1)
|
||||
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
|
||||
return
|
||||
end
|
||||
end
|
||||
else
|
||||
sceneTemp=1
|
||||
end
|
||||
end
|
||||
function sceneInit.mode(org)
|
||||
BG.set("space")
|
||||
BGM.play("blank")
|
||||
destroyPlayers()
|
||||
local cam=mapCam
|
||||
cam.zoomK=org=="main"and 5 or 1
|
||||
if cam.sel then
|
||||
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
|
||||
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={
|
||||
sure=0,
|
||||
pen=1,
|
||||
x=1,y=1,
|
||||
demo=false,
|
||||
}
|
||||
end
|
||||
function sceneInit.play()
|
||||
love.keyboard.setKeyRepeat(false)
|
||||
restartCount=0
|
||||
if needResetGameData then
|
||||
resetGameData()
|
||||
needResetGameData=nil
|
||||
end
|
||||
BG.set(modeEnv.bg)
|
||||
end
|
||||
function sceneInit.pause(org)
|
||||
if
|
||||
org=="setting_game"or
|
||||
org=="setting_video"or
|
||||
org=="setting_sound"
|
||||
then
|
||||
TEXT.show(text.needRestart,640,440,50,"fly",.6)
|
||||
end
|
||||
local S=players[1].stat
|
||||
sceneTemp={
|
||||
timer=org=="play"and 0 or 50,
|
||||
list={
|
||||
toTime(S.time),
|
||||
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-%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[%.2f%%]",S.extraPiece,100*max(1-S.extraRate/S.piece,0)),
|
||||
},
|
||||
|
||||
--from right-down, 60 degree each
|
||||
radar={
|
||||
(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
|
||||
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
|
||||
for i=1,6 do
|
||||
A[i]=format("%.2f",A[i])..text.radarData[i]
|
||||
end
|
||||
local f=1
|
||||
for i=1,6 do
|
||||
if B[i]>.5 then f=2 end
|
||||
if B[i]>1 then f=3 break end
|
||||
end
|
||||
if f==1 then _.color,f={.4,.9,.5},1.25 --Vegetable
|
||||
elseif f==2 then _.color,f={.4,.7,.9},1 --Normal
|
||||
elseif f==3 then _.color,f={1,.3,.3},.626 --Diao
|
||||
end
|
||||
A={
|
||||
120*.5*f, 120*3^.5*.5*f,
|
||||
120*-.5*f, 120*3^.5*.5*f,
|
||||
120*-1*f, 120*0*f,
|
||||
120*-.5*f, 120*-3^.5*.5*f,
|
||||
120*.5*f, 120*-3^.5*.5*f,
|
||||
120*1*f, 120*0*f,
|
||||
}
|
||||
_.scale=f
|
||||
_.standard=A
|
||||
|
||||
for i=6,1,-1 do
|
||||
B[2*i-1],B[2*i]=B[i]*A[2*i-1],B[i]*A[2*i]
|
||||
end
|
||||
_.val=B
|
||||
end
|
||||
function sceneInit.setting_game()
|
||||
BG.set("space")
|
||||
end
|
||||
function sceneInit.setting_video()
|
||||
BG.set("space")
|
||||
end
|
||||
function sceneInit.setting_sound()
|
||||
sceneTemp={last=0,jump=0}--last sound time,animation count(10 to 0)
|
||||
BG.set("space")
|
||||
end
|
||||
function sceneInit.setting_control()
|
||||
sceneTemp={
|
||||
das=setting.das,
|
||||
arr=setting.arr,
|
||||
pos=0,
|
||||
dir=1,
|
||||
wait=30,
|
||||
}
|
||||
BG.set("strap")
|
||||
end
|
||||
function sceneInit.setting_key()
|
||||
sceneTemp={
|
||||
board=1,
|
||||
kb=1,js=1,
|
||||
kS=false,jS=false,
|
||||
}
|
||||
end
|
||||
function sceneInit.setting_touch()
|
||||
BG.set("game2")
|
||||
sceneTemp={
|
||||
default=1,
|
||||
snap=1,
|
||||
sel=nil,
|
||||
}
|
||||
end
|
||||
function sceneInit.setting_touchSwitch()
|
||||
BG.set("matrix")
|
||||
end
|
||||
function sceneInit.help()
|
||||
sceneTemp={
|
||||
pw=0,
|
||||
}
|
||||
BG.set("space")
|
||||
end
|
||||
function sceneInit.staff()
|
||||
sceneTemp={
|
||||
time=0,
|
||||
v=1,
|
||||
ct=0,
|
||||
}
|
||||
BG.set("space")
|
||||
end
|
||||
function sceneInit.stat()
|
||||
local S=stat
|
||||
sceneTemp={
|
||||
chart={
|
||||
A1=S.spin,A2=S.clear,
|
||||
X1=S.spin_S,X2=S.clear_S,
|
||||
Y1=S.spin_B,Y2=S.clear_B,
|
||||
},
|
||||
item={
|
||||
S.run,
|
||||
S.game,
|
||||
toTime(S.time),
|
||||
S.key.." "..S.rotate.." "..S.hold,
|
||||
S.piece.." "..S.row.." "..int(S.atk),
|
||||
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("parts/updateLog"),1}--scroll pos
|
||||
end
|
||||
function sceneInit.quit()
|
||||
love.timer.sleep(.3)
|
||||
love.event.quit()
|
||||
end
|
||||
|
||||
|
||||
local swap={
|
||||
none={1,0,NULL},
|
||||
flash={8,1,function()gc.clear(1,1,1)end},
|
||||
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.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.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.dpi,scr.h*scr.dpi)
|
||||
end},
|
||||
}--Scene swapping animations
|
||||
local backFunc={
|
||||
load=love.event.quit,
|
||||
pause=function()
|
||||
love.keyboard.setKeyRepeat(true)
|
||||
mergeStat(stat,players[1].stat)
|
||||
TASK.clear("play")
|
||||
end,
|
||||
setting_game= function()FILE.saveSetting()end,
|
||||
setting_video= function()FILE.saveSetting()end,
|
||||
setting_sound= function()FILE.saveSetting()end,
|
||||
setting_touch= function()FILE.saveVK()end,
|
||||
setting_key= function()FILE.saveKeyMap()end,
|
||||
setting_lang= function()FILE.saveSetting()end,
|
||||
}
|
||||
function SCN.swapUpdate()
|
||||
local S=SCN.swap
|
||||
S.time=S.time-1
|
||||
if S.time==S.mid then
|
||||
SCN.init(S.tar,SCN.cur)
|
||||
SCN.cur=S.tar
|
||||
WIDGET.set(Widgets[S.tar])
|
||||
collectgarbage()
|
||||
--Scene swapped this moment
|
||||
end
|
||||
if S.time==0 then
|
||||
SCN.swapping=false
|
||||
end
|
||||
end
|
||||
function SCN.init(s,org)
|
||||
if sceneInit[s]then sceneInit[s](org)end
|
||||
end
|
||||
function SCN.push(tar,style)
|
||||
if not SCN.swapping then
|
||||
local m=#SCN.seq
|
||||
SCN.seq[m+1]=tar or SCN.cur
|
||||
SCN.seq[m+2]=style or"fade"
|
||||
end
|
||||
end
|
||||
function SCN.pop()
|
||||
local _=SCN.seq
|
||||
_[#_-1]=nil
|
||||
end
|
||||
function SCN.swapTo(tar,style)
|
||||
local S=SCN.swap
|
||||
if not SCN.swapping and tar~=SCN.cur then
|
||||
SCN.swapping=true
|
||||
if not style then style="fade"end
|
||||
S.tar=tar
|
||||
S.style=style
|
||||
local swap=swap[style]
|
||||
S.time=swap[1]
|
||||
S.mid=swap[2]
|
||||
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
|
||||
local m=#SCN.seq
|
||||
if m>0 then
|
||||
SCN.swapTo(SCN.seq[m-1],SCN.seq[m])
|
||||
SCN.seq[m],SCN.seq[m-1]=nil
|
||||
--Poll&Back to preScene
|
||||
end
|
||||
end
|
||||
return SCN
|
||||
@@ -32,6 +32,9 @@ function SFX.loadAll()
|
||||
SFX.loadOne(i)
|
||||
end
|
||||
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
|
||||
local S=SFX.list[s]--source list
|
||||
12
Zframework/shader.lua
Normal file
12
Zframework/shader.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
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"),
|
||||
|
||||
rainbow=N("rainbow"),
|
||||
strap=N("strap"),
|
||||
aura=N("aura"),
|
||||
}
|
||||
4
Zframework/shader/alpha.glsl
Normal file
4
Zframework/shader/alpha.glsl
Normal file
@@ -0,0 +1,4 @@
|
||||
extern float a;
|
||||
vec4 effect(vec4 color,Image text,vec2 pos,vec2 scr_pos){
|
||||
return vec4(1.,1.,1.,sign(Texel(text,pos).a)*a);
|
||||
}
|
||||
42
Zframework/shader/aura.glsl
Normal file
42
Zframework/shader/aura.glsl
Normal file
@@ -0,0 +1,42 @@
|
||||
#define PI 3.1415926535897932384626
|
||||
extern float w,h;
|
||||
extern float t;
|
||||
vec4 effect(vec4 color,Image text,vec2 pos,vec2 scr_pos){
|
||||
float x=scr_pos.x/w;
|
||||
float y=scr_pos.y/h;
|
||||
float dx,dy;
|
||||
vec3 V=vec3(0.);
|
||||
|
||||
dx=0.5+cos(t*3.*0.26)*0.4-x;
|
||||
dy=0.5-sin(t*3.*0.62)*0.4-y;
|
||||
dx=sqrt(dx*dx+dy*dy);
|
||||
V.r=V.r+smoothstep(1.26,0.,dx);
|
||||
|
||||
dx=(0.5+cos(t*3.*0.32)*0.4)-x;
|
||||
dy=(0.5-sin(t*3.*0.80)*0.4)-y;
|
||||
dx=sqrt(dx*dx+dy*dy);
|
||||
V.g=V.g+smoothstep(1.26,0.,dx);
|
||||
|
||||
dx=(0.5-cos(t*3.*0.49)*0.4)-x;
|
||||
dy=(0.5+sin(t*3.*0.18)*0.4)-y;
|
||||
dx=sqrt(dx*dx+dy*dy);
|
||||
V.b=V.b+smoothstep(1.26,0.,dx);
|
||||
|
||||
dx=(0.5+cos(t*0.53)*0.4)-x;
|
||||
dy=(0.5-sin(t*0.46)*0.4)-y;
|
||||
dx=sqrt(dx*dx+dy*dy);
|
||||
V.rg+=vec2(smoothstep(0.626,0.,dx));
|
||||
|
||||
dx=(0.5+cos(t*0.98)*0.4)-x;
|
||||
dy=(0.5+sin(t*0.57)*0.4)-y;
|
||||
dx=sqrt(dx*dx+dy*dy);
|
||||
V.rb+=vec2(smoothstep(0.626,0.,dx));
|
||||
|
||||
dx=(0.5-cos(t*0.86)*0.4)-x;
|
||||
dy=(0.5-sin(t*0.32)*0.4)-y;
|
||||
dx=sqrt(dx*dx+dy*dy);
|
||||
V.gb+=vec2(smoothstep(0.626,0.,dx));
|
||||
|
||||
dx=1.626*max(max(V.r,V.g),V.b);
|
||||
return vec4(V/dx,1.);
|
||||
}
|
||||
5
Zframework/shader/glow.glsl
Normal file
5
Zframework/shader/glow.glsl
Normal file
@@ -0,0 +1,5 @@
|
||||
extern float X,Y,W,H;
|
||||
vec4 effect(vec4 C,Image Tx,vec2 pos,vec2 scr_pos){
|
||||
C[3]=min((scr_pos.x-X)/W*0.3+(scr_pos.y-Y)/H*0.1,0.3)+0.5;
|
||||
return C;
|
||||
}
|
||||
29
Zframework/shader/lightRender.glsl
Normal file
29
Zframework/shader/lightRender.glsl
Normal file
@@ -0,0 +1,29 @@
|
||||
#define PI 3.14159
|
||||
extern float xresolution;
|
||||
//sample from 1D vis-depth map
|
||||
float samp(vec2 coord,float r,Image u_texture){
|
||||
return step(r,Texel(u_texture,coord).r);
|
||||
}
|
||||
vec4 effect(vec4 color,Image texture,vec2 texture_coords,vec2 screen_coords){
|
||||
//cartesian to polar, y of 1D sample is always 0
|
||||
vec2 norm=texture_coords.st*2.-1.;
|
||||
vec2 tc=vec2((atan(norm.y,norm.x)+PI)/(2.*PI),0.);
|
||||
float r=length(norm);
|
||||
|
||||
//enlarge blur parameter by distance, light scattering simulation
|
||||
float blur=(1./xresolution)*smoothstep(0.3,1.,r);
|
||||
|
||||
//Simple Gaussian blur
|
||||
float sum=//brightness(0~1)
|
||||
samp(vec2(tc.x-3.*blur,tc.y),r,texture)*0.1
|
||||
+samp(vec2(tc.x-2.*blur,tc.y),r,texture)*0.13
|
||||
+samp(vec2(tc.x-1.*blur,tc.y),r,texture)*0.17
|
||||
|
||||
+samp(tc,r,texture)*0.2//The center tex coord,which gives us hard shadows.
|
||||
+samp(vec2(tc.x+1.*blur,tc.y),r,texture)*0.17
|
||||
+samp(vec2(tc.x+2.*blur,tc.y),r,texture)*0.13
|
||||
+samp(vec2(tc.x+3.*blur,tc.y),r,texture)*0.1;
|
||||
|
||||
//Multiply the distance to get a soft fading
|
||||
return vec4(vec3(1.),sum*smoothstep(1.,0.,r));
|
||||
}
|
||||
15
Zframework/shader/rainbow.glsl
Normal file
15
Zframework/shader/rainbow.glsl
Normal file
@@ -0,0 +1,15 @@
|
||||
#define PI 3.14159265
|
||||
extern float w,h;
|
||||
extern float t;
|
||||
vec4 effect(vec4 color,Image text,vec2 pos,vec2 scr_pos){
|
||||
float x=scr_pos.x-w/2.;
|
||||
float y=scr_pos.y-h/2.;
|
||||
float a=(step(0.,x)*2.-1.)*PI+atan(y,x)+PI*0.5+t*0.626;
|
||||
|
||||
return vec4(
|
||||
color.r*(sin(a+PI*0./3.)*0.3+0.5),
|
||||
color.g*(sin(a+PI*2./3.)*0.3+0.5),
|
||||
color.b*(sin(a+PI*4./3.)*0.3+0.5),
|
||||
1.
|
||||
);
|
||||
}
|
||||
21
Zframework/shader/shadowMap.glsl
Normal file
21
Zframework/shader/shadowMap.glsl
Normal file
@@ -0,0 +1,21 @@
|
||||
#define PI 3.14
|
||||
extern float yresolution;
|
||||
vec4 effect(vec4 color,Image texture,vec2 texture_coords,vec2 screen_coords){
|
||||
//Iterate through the occluder map's y-axis.
|
||||
for(float y=0.;y<yresolution;y++){
|
||||
//cartesian to polar
|
||||
// y/yresolution=distance to light source(0~1)
|
||||
vec2 norm=vec2(texture_coords.s,y/yresolution)*2.-1.;
|
||||
float theta=PI*1.5+norm.x*PI;
|
||||
float r=(1.+norm.y)*0.5;
|
||||
|
||||
//sample from solid
|
||||
if(
|
||||
Texel(texture,(
|
||||
vec2(-r*sin(theta),-r*cos(theta))*0.5+0.5//coord of solid sampling
|
||||
))
|
||||
.a>0.1
|
||||
)return vec4(vec3(y/yresolution),1.);//collision check, alpha>0.1 means transparent
|
||||
}
|
||||
return vec4(1.,1.,1.,1.);//return max distance 1
|
||||
}
|
||||
11
Zframework/shader/strap.glsl
Normal file
11
Zframework/shader/strap.glsl
Normal file
@@ -0,0 +1,11 @@
|
||||
#define PI 3.14159265
|
||||
extern float t;
|
||||
vec4 effect(vec4 color,Image text,vec2 pos,vec2 scr_pos){
|
||||
float x=scr_pos.x/262.+t;
|
||||
return vec4(
|
||||
color.r*(sin(x+PI*0./3.)*0.3+0.5),
|
||||
color.g*(sin(x+PI*2./3.)*0.3+0.5),
|
||||
color.b*(sin(x+PI*4./3.)*0.3+0.5),
|
||||
1.
|
||||
);
|
||||
}
|
||||
8
Zframework/shader/warning.glsl
Normal file
8
Zframework/shader/warning.glsl
Normal file
@@ -0,0 +1,8 @@
|
||||
extern float w,h;
|
||||
extern float level;
|
||||
vec4 effect(vec4 color,Image text,vec2 pos,vec2 scr_pos){
|
||||
float dx=abs(scr_pos.x/w-0.5);
|
||||
float dy=abs(scr_pos.y/h-0.5);
|
||||
float a=(max(dx,dy)*2.-.626)*level;
|
||||
return vec4(1.,0.,0.,a);
|
||||
}
|
||||
@@ -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
|
||||
@@ -3,6 +3,8 @@ local rnd=math.random
|
||||
local mStr=mStr
|
||||
local rem=table.remove
|
||||
|
||||
local texts={}
|
||||
|
||||
local textFX={}
|
||||
function textFX.appear(t)
|
||||
mStr(t.text,t.x,t.y-t.font*.7)
|
||||
@@ -64,11 +66,14 @@ function textFX.beat(t)
|
||||
end
|
||||
function textFX.mark(t)
|
||||
local _,_,_,T=gc.getColor()
|
||||
gc.setColor(1,1,1,T*.06626)
|
||||
gc.setColor(1,1,1,T*.08)
|
||||
mStr(t.text,t.x,t.y-t.font*.7)
|
||||
end
|
||||
|
||||
local TEXT={}
|
||||
function TEXT.clear()
|
||||
texts={}
|
||||
end
|
||||
function TEXT.getText(text,x,y,font,style,spd,stop)
|
||||
return{
|
||||
c=0,
|
||||
@@ -78,7 +83,7 @@ function TEXT.getText(text,x,y,font,style,spd,stop)
|
||||
font=font or 40,
|
||||
spd=(spd or 1)/60,
|
||||
stop=stop,
|
||||
draw=textFX[style]or error("unavailable type:"..style),
|
||||
draw=textFX[style]or assert(false,"unavailable type:"..style),
|
||||
}
|
||||
end--another version of TEXT()
|
||||
function TEXT.show(text,x,y,font,style,spd,stop)
|
||||
@@ -90,10 +95,11 @@ function TEXT.show(text,x,y,font,style,spd,stop)
|
||||
font=font or 40, --font
|
||||
spd=(spd or 1)/60, --timing speed(1=last 1 sec)
|
||||
stop=stop, --stop time(sustained text)
|
||||
draw=textFX[style]or error("unavailable type:"..style), --draw method
|
||||
draw=textFX[style]or assert(false,"unavailable type:"..style), --draw method
|
||||
}
|
||||
end
|
||||
function TEXT.update(list)
|
||||
if not list then list=texts end
|
||||
for i=#list,1,-1 do
|
||||
local t=list[i]
|
||||
t.c=t.c+t.spd
|
||||
@@ -108,6 +114,7 @@ function TEXT.update(list)
|
||||
end
|
||||
end
|
||||
function TEXT.draw(list)
|
||||
if not list then list=texts end
|
||||
for i=1,#list do
|
||||
local t=list[i]
|
||||
local p=t.c
|
||||
@@ -1,59 +1,58 @@
|
||||
local gc=love.graphics
|
||||
local kb=love.keyboard
|
||||
local Timer=love.timer.getTime
|
||||
local int,abs,rnd,max,min,sin=math.floor,math.abs,math.random,math.max,math.min,math.sin
|
||||
local int,abs,rnd,max,min,sin,ln=math.floor,math.abs,math.random,math.max,math.min,math.sin,math.log
|
||||
local ins,rem=table.insert,table.remove
|
||||
|
||||
local Tmr={}
|
||||
function Tmr.load()
|
||||
local t=Timer()
|
||||
local S=sceneTemp
|
||||
::R::
|
||||
--L={stage,curPos,curLen}
|
||||
if S.phase==1 then
|
||||
VOC.loadOne(S.cur)
|
||||
elseif S.phase==2 then
|
||||
BGM.loadOne(S.cur)
|
||||
elseif S.phase==3 then
|
||||
SFX.loadOne(S.cur)
|
||||
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{}
|
||||
-- M.icon=gc.newImage("image/modeIcon/"..m.icon..".png")
|
||||
-- M.icon=gc.newImage("image/modeIcon/custom.png")
|
||||
elseif S.phase==6 then
|
||||
--------------------------Loading some other things here?
|
||||
skin.load()
|
||||
stat.run=stat.run+1
|
||||
--------------------------
|
||||
SFX.play("welcome_sfx")
|
||||
VOC.play("welcome")
|
||||
else
|
||||
repeat
|
||||
if S.phase==1 then
|
||||
VOC.loadOne(S.cur)
|
||||
elseif S.phase==2 then
|
||||
BGM.loadOne(S.cur)
|
||||
elseif S.phase==3 then
|
||||
SFX.loadOne(S.cur)
|
||||
elseif S.phase==4 then
|
||||
IMG.loadOne(S.cur)
|
||||
elseif S.phase==5 then
|
||||
local m=Modes[S.cur]--mode template
|
||||
local M=require("modes/"..m.name)--mode file
|
||||
Modes[m.name]=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
|
||||
--------------------------Loading other little things here
|
||||
SKIN.load()
|
||||
stat.run=stat.run+1
|
||||
--------------------------
|
||||
SFX.play("welcome_sfx")
|
||||
VOC.play("welcome")
|
||||
else
|
||||
S.cur=S.cur+1
|
||||
S.tar=S.cur
|
||||
if S.cur>62.6 then
|
||||
SCN.swapTo("intro","none")
|
||||
end
|
||||
return
|
||||
end
|
||||
S.cur=S.cur+1
|
||||
S.tar=S.cur
|
||||
if S.cur>62.6 then
|
||||
SCN.swapTo("intro","none")
|
||||
if S.cur>S.tar then
|
||||
S.phase=S.phase+1
|
||||
S.cur=1
|
||||
S.tar=S.list[S.phase]
|
||||
if not S.tar then
|
||||
S.phase=0
|
||||
S.tar=1
|
||||
end
|
||||
end
|
||||
return
|
||||
end
|
||||
S.cur=S.cur+1
|
||||
if S.cur>S.tar then
|
||||
S.phase=S.phase+1
|
||||
S.cur=1
|
||||
S.tar=S.list[S.phase]
|
||||
if not S.tar then
|
||||
S.phase=0
|
||||
S.tar=1
|
||||
end
|
||||
end
|
||||
if S.skip and not SCN.swapping then goto R end
|
||||
until not S.skip and Timer()-t>.01
|
||||
end
|
||||
function Tmr.intro()
|
||||
sceneTemp=sceneTemp+1
|
||||
@@ -69,13 +68,13 @@ local function dumpTable(L)
|
||||
T=type(k)
|
||||
if T=="number"then k="["..k.."]="
|
||||
elseif T=="string"then k=k.."="
|
||||
else error("Error data type!")
|
||||
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 error("Error data type!")
|
||||
else assert(false,"Error data type!")
|
||||
end
|
||||
s=s..k..v..",\n"
|
||||
end
|
||||
@@ -106,21 +105,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
|
||||
@@ -143,7 +140,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
|
||||
@@ -155,12 +152,16 @@ 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
|
||||
local b=FX_attack[i]
|
||||
b.t=b.t+1
|
||||
@@ -199,10 +200,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
|
||||
@@ -217,11 +218,11 @@ function Tmr.play(dt)
|
||||
end
|
||||
if restartCount>0 then restartCount=restartCount-1 end
|
||||
return
|
||||
elseif players[1].keyPressing[10]then
|
||||
elseif P1.keyPressing[10]then
|
||||
restartCount=restartCount+1
|
||||
if restartCount>20 then
|
||||
TASK.clear("play")
|
||||
mergeStat(stat,players[1].stat)
|
||||
mergeStat(stat,P1.stat)
|
||||
resetGameData()
|
||||
return
|
||||
end
|
||||
@@ -232,16 +233,40 @@ 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("游戏作者:MrZ_26\n出现此水印则为非法录屏上传",rnd(162,scr.w-162),rnd(126,scr.h-200),40,"mark",.626)
|
||||
end--mark 2s each 10s
|
||||
end
|
||||
if P1.alive then
|
||||
if game.frame%26==0 and setting.warn then
|
||||
local F=P1.field
|
||||
local M=#F
|
||||
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
|
||||
height=y
|
||||
end
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
game.warnLVL0=ln(height-15+P1.atkBuffer.sum*.8)
|
||||
end
|
||||
local M=game.warnLVL
|
||||
if M<game.warnLVL0 then
|
||||
M=M*.95+game.warnLVL0*.05
|
||||
elseif M>0 then
|
||||
M=max(M-.026,0)
|
||||
end
|
||||
game.warnLVL=M
|
||||
elseif game.warnLVL>0 then
|
||||
game.warnLVL=max(game.warnLVL-.026,0)
|
||||
end
|
||||
end
|
||||
function Tmr.pause(dt)
|
||||
if not gameResult then
|
||||
pauseTime=pauseTime+dt
|
||||
if not game.result then
|
||||
game.pauseTime=game.pauseTime+dt
|
||||
end
|
||||
if sceneTemp.timer<50 then
|
||||
sceneTemp.timer=sceneTemp.timer+1
|
||||
@@ -284,4 +309,18 @@ function Tmr.setting_control()
|
||||
end
|
||||
end
|
||||
end
|
||||
function Tmr.staff(dt)
|
||||
local S=sceneTemp
|
||||
if kb.isDown("space","return")and S.v<6.26 then
|
||||
S.v=S.v+.26
|
||||
elseif S.v>1 then
|
||||
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
42
Zframework/toolfunc.lua
Normal 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-400,y,800,"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
|
||||
@@ -1,7 +1,7 @@
|
||||
local level={0,.015,.02,.03,.04,.05,.06,.07,.08,.09}
|
||||
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
|
||||
@@ -85,30 +85,30 @@ end
|
||||
function VOC.update()
|
||||
for i=#voiceQueue,1,-1 do
|
||||
local Q=voiceQueue[i]
|
||||
if Q.s==0 then--闲置轨,自动删除多余
|
||||
if Q.s==0 then--Free channel, auto delete when >3
|
||||
if i>3 then
|
||||
rem(voiceQueue,i)
|
||||
end
|
||||
elseif Q.s==1 then--等待转换
|
||||
elseif Q.s==1 then--Waiting load source
|
||||
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
|
||||
elseif Q.s==2 then--playing 1,ready 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同时播放
|
||||
elseif Q.s==3 then--playing 12 same time
|
||||
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--最后播放
|
||||
elseif Q.s==4 then--playing last
|
||||
if not Q[1].isPlaying(Q[1])then
|
||||
Q[1]=nil
|
||||
Q.s=0
|
||||
@@ -121,12 +121,13 @@ function VOC.play(s,chn)
|
||||
if chn then
|
||||
local L=voiceQueue[chn]
|
||||
local _=VOC.list[s]
|
||||
if not _ then print("no VOC called:"..s)return end
|
||||
L[#L+1]=_[rnd(#_)]
|
||||
L.s=1
|
||||
--添加到queue[chn]
|
||||
--add to queue[chn]
|
||||
else
|
||||
voiceQueue[VOC.getFreeChannel()]={s=1,VOC.list[s][rnd(#VOC.list[s])]}
|
||||
--自动创建空轨/播放
|
||||
--create new channel & play
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,21 +1,14 @@
|
||||
local gc=love.graphics
|
||||
local kb=love.keyboard
|
||||
local int=math.floor
|
||||
local format=string.format
|
||||
local next=next
|
||||
local EMPTY={}
|
||||
|
||||
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,
|
||||
w=w,h=h,
|
||||
color=color,
|
||||
font=font,
|
||||
code=code,
|
||||
hide=hide,
|
||||
next=N,
|
||||
}for k,v in next,button do _[k]=v end return _
|
||||
end
|
||||
function button:reset()
|
||||
self.ATV=0
|
||||
end
|
||||
@@ -26,7 +19,7 @@ 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
|
||||
function button:update()
|
||||
if widget_sel==self then
|
||||
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
|
||||
@@ -65,15 +58,6 @@ local switch={
|
||||
ATV=0,--activating time(0~8)
|
||||
CHK=0,--check alpha(0~6)
|
||||
}
|
||||
function newSwitch(x,y,font,disp,code,hide,N)
|
||||
local _={
|
||||
x=x,y=y,font=font,
|
||||
disp=disp,
|
||||
code=code,
|
||||
hide=hide,
|
||||
next=N,
|
||||
}for k,v in next,switch do _[k]=v end return _
|
||||
end
|
||||
function switch:reset()
|
||||
self.ATV=0
|
||||
self.CHK=0
|
||||
@@ -83,7 +67,7 @@ function switch:isAbove(x,y)
|
||||
end
|
||||
function switch:update()
|
||||
local _=self.ATV
|
||||
if widget_sel==self then if _<8 then self.ATV=_+1 end
|
||||
if WIDGET.sel==self then if _<8 then self.ATV=_+1 end
|
||||
else if _>0 then self.ATV=_-1 end
|
||||
end
|
||||
_=self.CHK
|
||||
@@ -123,18 +107,6 @@ local 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,
|
||||
w=w,unit=unit,
|
||||
font=font,
|
||||
change=change,
|
||||
disp=disp,
|
||||
code=code,
|
||||
hide=hide,
|
||||
next=N,
|
||||
}for k,v in next,slider do _[k]=v end return _
|
||||
end
|
||||
function slider:reset()
|
||||
self.ATV=0
|
||||
self.pos=0
|
||||
@@ -143,7 +115,7 @@ 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:update()
|
||||
if widget_sel==self then
|
||||
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
|
||||
@@ -184,4 +156,154 @@ function slider:draw()
|
||||
end
|
||||
function slider:getInfo()
|
||||
print(format("x=%d,y=%d,w=%d",self.x,self.y,self.w))
|
||||
end
|
||||
end
|
||||
|
||||
local WIDGET={}
|
||||
WIDGET.active=EMPTY--table, contains all active widgets
|
||||
WIDGET.sel=nil--selected widget
|
||||
function WIDGET.set(L)
|
||||
WIDGET.sel=nil
|
||||
WIDGET.active=L or EMPTY
|
||||
if L then
|
||||
for _,W in next,L do
|
||||
W:reset()
|
||||
end--Reset all widgets
|
||||
end
|
||||
end
|
||||
|
||||
WIDGET.new={}
|
||||
function WIDGET.new.button(x,y,w,h,color,font,code,hide,N)
|
||||
local _={
|
||||
x=x-w*.5,y=y-h*.5,
|
||||
w=w,h=h,
|
||||
color=color,
|
||||
font=font,
|
||||
code=code,
|
||||
hide=hide,
|
||||
next=N,
|
||||
}for k,v in next,button do _[k]=v end return _
|
||||
end
|
||||
function WIDGET.new.switch(x,y,font,disp,code,hide,N)
|
||||
local _={
|
||||
x=x,y=y,font=font,
|
||||
disp=disp,
|
||||
code=code,
|
||||
hide=hide,
|
||||
next=N,
|
||||
}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)
|
||||
local _={
|
||||
x=x,y=y,
|
||||
w=w,unit=unit,
|
||||
font=font,
|
||||
change=change,
|
||||
disp=disp,
|
||||
code=code,
|
||||
hide=hide,
|
||||
next=N,
|
||||
}for k,v in next,slider do _[k]=v end return _
|
||||
end
|
||||
|
||||
function WIDGET.moveCursor(x,y)
|
||||
WIDGET.sel=nil
|
||||
for _,W in next,WIDGET.active do
|
||||
if not(W.hide and W.hide())and W:isAbove(x,y)then
|
||||
WIDGET.sel=W
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
function WIDGET.press(x,y)
|
||||
local W=WIDGET.sel
|
||||
if not W then return end
|
||||
if W.type=="button"then
|
||||
W.code()
|
||||
W:FX()
|
||||
SFX.play("button")
|
||||
VOC.play("nya")
|
||||
elseif W.type=="switch"then
|
||||
W.code()
|
||||
SFX.play("move",.6)
|
||||
elseif W.type=="slider"then
|
||||
if not x then return end
|
||||
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
|
||||
function WIDGET.drag(x,y,dx,dy)
|
||||
local W=WIDGET.sel
|
||||
if not W then return end
|
||||
if W.type=="slider"then
|
||||
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
|
||||
end
|
||||
end
|
||||
function WIDGET.keyPressed(i)
|
||||
if i=="tab"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))
|
||||
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
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
function WIDGET.gamepadPressed(i)
|
||||
if i=="dpup"or i=="dpdown"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))
|
||||
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
|
||||
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
|
||||
end
|
||||
|
||||
function WIDGET.update()
|
||||
for _,W in next,WIDGET.active do W:update()end
|
||||
end
|
||||
function WIDGET.draw()
|
||||
for _,W in next,WIDGET.active do
|
||||
if not(W.hide and W.hide())then
|
||||
W:draw()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return WIDGET
|
||||
@@ -1,4 +1,6 @@
|
||||
local mobile=system=="Android"or system=="iOS"
|
||||
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
|
||||
@@ -71,76 +73,97 @@ local virtualkeySet={
|
||||
{20,1210, 50,30},--addRight
|
||||
},--PC key feedback(top&in a row)
|
||||
}
|
||||
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},
|
||||
{25,11,8,11,4,1,2,1,8,3,1,4,9},
|
||||
}
|
||||
--λFuncs for widgets,delete at file end
|
||||
function defSet(n)
|
||||
return function()
|
||||
for i=1,#customSet[n]do
|
||||
customSel[i]=customSet[n][i]
|
||||
end
|
||||
BG.set(customRange.bg[customSel[12]])
|
||||
BGM.play(customRange.bgm[customSel[13]])
|
||||
end
|
||||
end
|
||||
function SETval(k) return function()return setting[k] end end
|
||||
function SETsto(k) return function(i)setting[k]=i end end
|
||||
function SETrev(k) return function()setting[k]=not setting[k] end end
|
||||
function pressKey(k)return function()love.keypressed(k) end end
|
||||
function setPen(i) return function()sceneTemp.pen=i end end
|
||||
function prevSkin(n)return function()skin.prev(n) end end
|
||||
function nextSkin(n)return function()skin.next(n) end end
|
||||
function nextDir(n) return function()skin.rotate(n) end end
|
||||
function VKAdisp(n) return function()return VK_org[n].ava end end
|
||||
function VKAcode(n) return function()VK_org[n].ava=not VK_org[n].ava end end
|
||||
|
||||
--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
|
||||
local function SEQpush(n) return function()local C=sceneTemp.cur+1 ins(preBag,C,n)sceneTemp.cur=C end end
|
||||
local newButton,newSwitch,newSlider=WIDGET.new.button,WIDGET.new.switch,WIDGET.new.slider
|
||||
|
||||
|
||||
local C=color
|
||||
local Widget={
|
||||
local Widgets={
|
||||
load={},intro={},quit={},
|
||||
main={
|
||||
play= newButton(150,280,200,160,C.lightRed, 55,function()SCN.push()SCN.swapTo("mode")end, nil,"setting"),
|
||||
setting=newButton(370,280,200,160,C.lightBlue, 45,function()SCN.push()SCN.swapTo("setting_game")end, nil,"music"),
|
||||
music= newButton(590,280,200,160,C.lightPurple, 32,function()SCN.push()SCN.swapTo("music")end, nil,"help"),
|
||||
help= newButton(150,460,200,160,C.lightYellow, 50,function()SCN.push()SCN.swapTo("help")end, nil,"stat"),
|
||||
stat= newButton(370,460,200,160,C.lightCyan, 43,function()SCN.push()SCN.swapTo("stat")end, nil,"qplay"),
|
||||
play= newButton(150,280,200,160,C.lightRed, 55,function()SCN.goto("mode")end, nil,"setting"),
|
||||
setting=newButton(370,280,200,160,C.lightBlue, 45,function()SCN.goto("setting_game")end, nil,"music"),
|
||||
music= newButton(590,280,200,160,C.lightPurple, 32,function()SCN.goto("music")end, nil,"help"),
|
||||
help= newButton(150,460,200,160,C.lightYellow, 50,function()SCN.goto("help")end, nil,"stat"),
|
||||
stat= newButton(370,460,200,160,C.lightCyan, 43,function()SCN.goto("stat")end, nil,"qplay"),
|
||||
qplay= newButton(590,460,200,160,C.lightOrange, 43,function()SCN.push()loadGame(stat.lastPlay)end, nil,"lang"),
|
||||
lang= newButton(150,610,160,100,C.lightGreen, 45,function()
|
||||
setting.lang=setting.lang%LANG.getLen()+1
|
||||
LANG.set(setting.lang)
|
||||
TEXT.show(text.lang,370,610,50,"appear",1.6)
|
||||
end,nil,"quit"),
|
||||
lang= newButton(150,610,160,100,C.lightGreen, 45,function()SCN.goto("setting_lang")end, nil,"quit"),
|
||||
quit= newButton(590,610,160,100,C.lightGrey, 45,function()VOC.play("bye")SCN.swapTo("quit","slowFade")end,nil,"play"),
|
||||
},
|
||||
mode={
|
||||
draw= newButton(1100, 440,220,90,C.lightYellow, 40,function()SCN.push()SCN.swapTo("draw")end,function()return mapCam.sel~=71 and mapCam.sel~=72 end),
|
||||
custom=newButton(1100, 540,220,90,C.lightGreen, 40,function()SCN.push()SCN.swapTo("custom")end,function()return mapCam.sel~=71 and mapCam.sel~=72 end),
|
||||
setting=newButton(1100, 540,240,90,C.lightGreen, 40,function()SCN.goto("custom")end,function()return mapCam.sel~="custom_clear" and mapCam.sel~="custom_puzzle" end),
|
||||
start= newButton(1040, 655,180,80,C.lightGrey, 40,function()if mapCam.sel then SCN.push()loadGame(mapCam.sel)end end,function()return not mapCam.sel end),
|
||||
back= newButton(1200, 655,120,80,C.white, 40,SCN.back),
|
||||
--function()SCN.push()SCN.swapTo("custom")end
|
||||
back= newButton(1200, 655,120,80,C.white, 40,BACK),
|
||||
},
|
||||
music={
|
||||
bgm= newSlider(760, 80,400,10,35,function()BGM.freshVolume()end,SETval("bgm"),SETsto("bgm")),
|
||||
up= newButton(1100, 200,120,120,C.white,55,pressKey("up")),
|
||||
play= newButton(1100, 340,120,120,C.white,35,pressKey("space"),function()return setting.bgm==0 end),
|
||||
down= newButton(1100, 480,120,120,C.white,55,pressKey("down")),
|
||||
back= newButton(640, 630,230,90, C.white,40,SCN.back),
|
||||
up= newButton(1100, 200,120,120,C.white, 55,pressKey("up")),
|
||||
play= newButton(1100, 340,120,120,C.white, 35,pressKey("space"),function()return setting.bgm==0 end),
|
||||
down= newButton(1100, 480,120,120,C.white, 55,pressKey("down")),
|
||||
back= newButton(640, 630,230,90, C.white, 40,BACK),
|
||||
},
|
||||
custom={
|
||||
up= newButton(1000, 360,100,100,C.white, 45,function()sceneTemp=(sceneTemp-2)%#customID+1 end),
|
||||
down= newButton(1000, 600,100,100,C.white, 45,function()sceneTemp=sceneTemp%#customID+1 end),
|
||||
left= newButton(880, 480,100,100,C.white, 45,pressKey("left")),
|
||||
right= newButton(1120, 480,100,100,C.white, 45,pressKey("right")),
|
||||
set1= newButton(640, 160,240,75, C.lightYellow, 35,defSet(1)),
|
||||
set2= newButton(640, 250,240,75, C.lightYellow, 35,defSet(2)),
|
||||
set3= newButton(640, 340,240,75, C.lightYellow, 35,defSet(3)),
|
||||
set4= newButton(640, 430,240,75, C.lightYellow, 35,defSet(4)),
|
||||
set5= newButton(640, 520,240,75, C.lightYellow, 35,defSet(5)),
|
||||
back= newButton(640, 630,180,60, C.white, 35,SCN.back),
|
||||
up= newButton(1140, 100,100,100,C.white, 45,function()sceneTemp=(sceneTemp-2)%#customID+1 end),
|
||||
down= newButton(1140, 340,100,100,C.white, 45,function()sceneTemp=sceneTemp%#customID+1 end),
|
||||
left= newButton(1080, 220,100,100,C.white, 45,pressKey("left")),
|
||||
right= newButton(1200, 220,100,100,C.white, 45,pressKey("right")),
|
||||
|
||||
set1= newButton(940, 320,260,70, C.lightYellow, 32,pressKey("1")),
|
||||
set2= newButton(940, 400,260,70, C.lightYellow, 32,pressKey("2")),
|
||||
set3= newButton(940, 480,260,70, C.lightYellow, 32,pressKey("3")),
|
||||
set4= newButton(940, 560,260,70, C.lightYellow, 32,pressKey("4")),
|
||||
set5= newButton(940, 640,260,70, C.lightYellow, 32,pressKey("5")),
|
||||
|
||||
seq= newButton(665, 415,162,40, C.lightGreen, 32,function()SCN.goto("sequence")end),
|
||||
draw= newButton(150, 80, 220,80, C.white, 35,function()SCN.swapTo("draw")end),
|
||||
back= newButton(1200, 640,120,120,C.white, 35,BACK),
|
||||
},
|
||||
sequence={
|
||||
Z= newButton(150, 440,90, 90,C.white, 50,SEQpush(1)),
|
||||
S= newButton(250, 440,90, 90,C.white, 50,SEQpush(2)),
|
||||
J= newButton(350, 440,90, 90,C.white, 50,SEQpush(3)),
|
||||
L= newButton(450, 440,90, 90,C.white, 50,SEQpush(4)),
|
||||
T= newButton(550, 440,90, 90,C.white, 50,SEQpush(5)),
|
||||
O= newButton(650, 440,90, 90,C.white, 50,SEQpush(6)),
|
||||
I= newButton(750, 440,90, 90,C.white, 50,SEQpush(7)),
|
||||
|
||||
Z5= newButton(150, 540,90, 90,C.white, 50,SEQpush(8)),
|
||||
S5= newButton(250, 540,90, 90,C.white, 50,SEQpush(9)),
|
||||
P= newButton(350, 540,90, 90,C.white, 50,SEQpush(10)),
|
||||
Q= newButton(450, 540,90, 90,C.white, 50,SEQpush(11)),
|
||||
F= newButton(550, 540,90, 90,C.white, 50,SEQpush(12)),
|
||||
E= newButton(650, 540,90, 90,C.white, 50,SEQpush(13)),
|
||||
T5= newButton(750, 540,90, 90,C.white, 50,SEQpush(14)),
|
||||
U= newButton(850, 540,90, 90,C.white, 50,SEQpush(15)),
|
||||
V= newButton(950, 540,90, 90,C.white, 50,SEQpush(16)),
|
||||
W= newButton(150, 640,90, 90,C.white, 50,SEQpush(17)),
|
||||
X= newButton(250, 640,90, 90,C.white, 50,SEQpush(18)),
|
||||
J5= newButton(350, 640,90, 90,C.white, 50,SEQpush(19)),
|
||||
L5= newButton(450, 640,90, 90,C.white, 50,SEQpush(20)),
|
||||
R= newButton(550, 640,90, 90,C.white, 50,SEQpush(21)),
|
||||
Y= newButton(650, 640,90, 90,C.white, 50,SEQpush(22)),
|
||||
N= newButton(750, 640,90, 90,C.white, 50,SEQpush(23)),
|
||||
H= newButton(850, 640,90, 90,C.white, 50,SEQpush(24)),
|
||||
I5= newButton(950, 640,90, 90,C.white, 50,SEQpush(25)),
|
||||
|
||||
left= newButton(850, 440,90, 90,C.lightGreen, 55,pressKey("left")),
|
||||
right= newButton(950, 440,90, 90,C.lightGreen, 55,pressKey("right")),
|
||||
backsp= newButton(1050, 440,90, 90,C.lightRed, 50,pressKey("backspace")),
|
||||
reset= newButton(1050, 540,90, 90,C.lightRed, 50,pressKey("delete")),
|
||||
back= newButton(1200, 640,120,120,C.white, 35,BACK),
|
||||
},
|
||||
draw={
|
||||
b1= newButton(500+65*1, 150,58,58,C.red, 30,setPen(1)),--B1
|
||||
@@ -168,77 +191,82 @@ local Widget={
|
||||
demo= newSwitch(755, 640,30,function()return sceneTemp.demo end,function()sceneTemp.demo=not sceneTemp.demo end),
|
||||
copy= newButton(920, 640,120,120,C.lightRed, 35,copyBoard),
|
||||
paste= newButton(1060, 640,120,120,C.lightBlue, 35,pasteBoard),
|
||||
back= newButton(1200, 640,120,120,C.white, 35,SCN.back),
|
||||
custom= newButton(110, 80, 140,80, C.white, 35,function()SCN.goto("custom")end),
|
||||
back= newButton(1200, 640,120,120,C.white, 35,BACK),
|
||||
},
|
||||
play={
|
||||
pause= newButton(1235,45,80,80,C.white,25,pauseGame),
|
||||
pause= newButton(1235,45,80,80,C.white,25,function()pauseGame()end),
|
||||
},
|
||||
pause={
|
||||
resume= newButton(640,290,240,100,C.white,30,resumeGame),
|
||||
resume= newButton(640,290,240,100,C.white,30,function()resumeGame()end),
|
||||
restart=newButton(640,445,240,100,C.white,33,function()
|
||||
TASK.clear("play")
|
||||
TASK.removeTask_code(TICK.autoPause)
|
||||
mergeStat(stat,players[1].stat)
|
||||
resetGameData()
|
||||
SCN.swapTo("play","none")
|
||||
end),
|
||||
setting=newButton(1130,70,180,90,C.lightBlue,35,function()
|
||||
SCN.push()SCN.swapTo("setting_sound")
|
||||
setting=newButton(1120,70,240,90,C.lightBlue,35,function()
|
||||
SCN.goto("setting_sound")
|
||||
end),
|
||||
quit= newButton(640,600,240,100,C.white,35,SCN.back),
|
||||
quit= newButton(640,600,240,100,C.white,35,BACK),
|
||||
},
|
||||
setting_game={
|
||||
graphic=newButton(200,80,240,80,C.lightCyan,35,function()SCN.swapTo("setting_graphic")end, nil,"sound"),
|
||||
graphic=newButton(200,80,240,80,C.lightCyan,35,function()SCN.swapTo("setting_video")end, nil,"sound"),
|
||||
sound= newButton(1080,80,240,80,C.lightCyan,35,function()SCN.swapTo("setting_sound")end, nil,"ctrl"),
|
||||
ctrl= newButton(290,220,320,80,C.lightYellow,35,function()SCN.push()SCN.swapTo("setting_control")end, nil,"key"),
|
||||
key= newButton(640,220,320,80,C.lightGreen,35,function()SCN.push()SCN.swapTo("setting_key")end, nil,"touch"),
|
||||
touch= newButton(990,220,320,80,C.lightBlue,35,function()SCN.push()SCN.swapTo("setting_touch")end, nil,"reTime"),
|
||||
ctrl= newButton(290,220,320,80,C.lightYellow,35,function()SCN.goto("setting_control")end, nil,"key"),
|
||||
key= newButton(640,220,320,80,C.lightGreen,35,function()SCN.goto("setting_key")end, nil,"touch"),
|
||||
touch= newButton(990,220,320,80,C.lightBlue,35,function()SCN.goto("setting_touch")end, nil,"reTime"),
|
||||
reTime= newSlider(350,340,300,10,30,nil, SETval("reTime"), SETsto("reTime"), nil,"maxNext"),
|
||||
maxNext=newSlider(350,440,300,6,30,nil, SETval("maxNext"), SETsto("maxNext"), nil,"autoPause"),
|
||||
autoPause=newSwitch(350,540,20, SETval("autoPause"), SETrev("autoPause"), nil,"layout"),
|
||||
layout= newButton(590,540,140,70,C.white,35,function()
|
||||
SCN.push()
|
||||
SCN.swapTo("setting_skin")
|
||||
SCN.goto("setting_skin")
|
||||
end,nil,"quickR"),
|
||||
quickR= newSwitch(1050,340,35, SETval("quickR"), SETrev("quickR"), nil,"swap"),
|
||||
swap= newSwitch(1050,440,19, SETval("swap"), SETrev("swap"), nil,"fine"),
|
||||
fine= newSwitch(1050,540,20, SETval("fine"), SETrev("fine"), nil,"back"),
|
||||
back= newButton(1140,650,200,80,C.white,40,SCN.back, nil,"graphic"),
|
||||
back= newButton(1140,650,200,80,C.white,40,BACK, nil,"graphic"),
|
||||
},
|
||||
setting_graphic={
|
||||
setting_video={
|
||||
sound= newButton(200,80,240,80,C.lightCyan,35,function()SCN.swapTo("setting_sound")end, nil,"game"),
|
||||
game= newButton(1080,80,240,80,C.lightCyan,35,function()SCN.swapTo("setting_game")end, nil,"ghost"),
|
||||
ghost= newSwitch(230,180,35, SETval("ghost"), SETrev("ghost"), nil,"smooth"),
|
||||
smooth= newSwitch(230,260,25, SETval("smooth"), SETrev("smooth"), nil,"center"),
|
||||
center= newSwitch(480,180,35, SETval("center"), SETrev("center"), nil,"grid"),
|
||||
grid= newSwitch(480,260,30, SETval("grid"), SETrev("grid"), nil,"bagLine"),
|
||||
ghost= newSwitch(250,180,35, SETval("ghost"), SETrev("ghost"), nil,"smooth"),
|
||||
smooth= newSwitch(250,260,25, SETval("smooth"), SETrev("smooth"), nil,"center"),
|
||||
center= newSwitch(500,180,35, SETval("center"), SETrev("center"), nil,"grid"),
|
||||
grid= newSwitch(500,260,30, SETval("grid"), SETrev("grid"), nil,"bagLine"),
|
||||
bagLine=newSwitch(730,180,30, SETval("bagLine"), SETrev("bagLine"), nil,"lockFX"),
|
||||
lockFX= newSlider(310,340,373,3,35,nil, SETval("lockFX"), SETsto("lockFX"), nil,"dropFX"),
|
||||
dropFX= newSlider(310,410,373,5,35,nil, SETval("dropFX"), SETsto("dropFX"), nil,"shakeFX"),
|
||||
shakeFX=newSlider(310,480,373,5,35,nil, SETval("shakeFX"), SETsto("shakeFX"), nil,"atkFX"),
|
||||
atkFX= newSlider(310,550,373,5,35,nil, SETval("atkFX"), SETsto("atkFX"), nil,"frame"),
|
||||
frame= newSlider(310,620,373,10,35,nil,function()return setting.frameMul>35 and setting.frameMul/10 or setting.frameMul/5-4 end,function(i)setting.frameMul=i<5 and 5*i+20 or 10*i end,nil,"text"),
|
||||
text= newSwitch(990,180,35,SETval("text"),SETrev("text"),nil,"fullscreen"),
|
||||
fullscreen=newSwitch(990,260,35,SETval("fullscreen"),function()
|
||||
lockFX= newSlider(350,340,373,3,32,nil, SETval("lockFX"), SETsto("lockFX"), nil,"dropFX"),
|
||||
dropFX= newSlider(350,400,373,5,32,nil, SETval("dropFX"), SETsto("dropFX"), nil,"clearFX"),
|
||||
clearFX=newSlider(350,460,373,3,32,nil, SETval("clearFX"), SETsto("clearFX"), nil,"shakeFX"),
|
||||
shakeFX=newSlider(350,520,373,5,32,nil, SETval("shakeFX"), SETsto("shakeFX"), nil,"atkFX"),
|
||||
atkFX= newSlider(350,580,373,5,32,nil, SETval("atkFX"), SETsto("atkFX"), nil,"frame"),
|
||||
frame= newSlider(350,640,373,10,30,nil,function()return setting.frameMul>35 and setting.frameMul/10 or setting.frameMul/5-4 end,function(i)setting.frameMul=i<5 and 5*i+20 or 10*i end,nil,"text"),
|
||||
text= newSwitch(1050,180,35,SETval("text"),SETrev("text"),nil,"warn"),
|
||||
warn= newSwitch(1050,260,35,SETval("warn"),SETrev("warn"),nil,"fullscreen"),
|
||||
fullscreen=newSwitch(1050,340,35,SETval("fullscreen"),function()
|
||||
setting.fullscreen=not setting.fullscreen
|
||||
love.window.setFullscreen(setting.fullscreen)
|
||||
love.resize(love.graphics.getWidth(),love.graphics.getHeight())
|
||||
end,nil,"bg"),
|
||||
bg= newSwitch(990,330,35,SETval("bg"),function()
|
||||
bg= newSwitch(1050,420,35,SETval("bg"),function()
|
||||
BG.set("none")
|
||||
setting.bg=not setting.bg
|
||||
BG.set("space")
|
||||
end,nil,"power"),
|
||||
power= newSwitch(1050,500,35,SETval("powerInfo"),function()
|
||||
setting.powerInfo=not setting.powerInfo
|
||||
end,nil,"back"),
|
||||
back= newButton(1140,650,200,80,C.white,40,SCN.back,nil,"sound"),
|
||||
back= newButton(1140,650,200,80,C.white,40,BACK,nil,"sound"),
|
||||
},
|
||||
setting_sound={
|
||||
game= newButton(200,80,240,80,C.lightCyan,35,function()SCN.swapTo("setting_game")end, nil,"graphic"),
|
||||
graphic=newButton(1080,80,240,80,C.lightCyan,35,function()SCN.swapTo("setting_graphic")end, nil,"sfx"),
|
||||
graphic=newButton(1080,80,240,80,C.lightCyan,35,function()SCN.swapTo("setting_video")end, nil,"sfx"),
|
||||
sfx= newSlider(180,250,400,10,35,function()SFX.play("blip_1")end, SETval("sfx"), SETsto("sfx"), nil,"bgm"),
|
||||
bgm= newSlider(750,250,400,10,35,function()BGM.freshVolume()end, SETval("bgm"), SETsto("bgm"), nil,"vib"),
|
||||
vib= newSlider(180,440,400,5 ,28,function()VIB(1)end, SETval("vib"), SETsto("vib"), nil,"voc"),
|
||||
vib= newSlider(180,440,400,5 ,28,function()VIB(2)end, SETval("vib"), SETsto("vib"), nil,"voc"),
|
||||
voc= newSlider(750,440,400,10,32,function()VOC.play("nya")end, SETval("voc"), SETsto("voc"), nil,"stereo"),
|
||||
stereo= newSlider(180,630,400,10,35,function()SFX.play("move",1,-1)SFX.play("lock",1,1)end, SETval("stereo"), SETsto("stereo"),function()return setting.sfx==0 end,"back"),
|
||||
back= newButton(1140,650,200,80,C.white,40,SCN.back,nil,"game"),
|
||||
back= newButton(1140,650,200,80,C.white,40,BACK,nil,"game"),
|
||||
},
|
||||
setting_control={
|
||||
das= newSlider(226,200,910, 26, 30,nil,SETval("das"), SETsto("das"), nil,"arr"),
|
||||
@@ -254,14 +282,14 @@ local Widget={
|
||||
_.sddas,_.sdarr=0,2
|
||||
_.ihs,_.irs,_.ims=false,false,false
|
||||
end,nil,"back"),
|
||||
back= newButton(1140,650,200,80,C.white,40,SCN.back,nil,"das"),
|
||||
back= newButton(1140,650,200,80,C.white,40,BACK,nil,"das"),
|
||||
},
|
||||
setting_key={
|
||||
back=newButton(1140,650,200,80,C.white,45,SCN.back),
|
||||
back=newButton(1140,650,200,80,C.white,45,BACK),
|
||||
},
|
||||
setting_skin={
|
||||
prev= newButton(700,100,140,100,C.white,50,function()skin.prevSet()end),
|
||||
next= newButton(860,100,140,100,C.white,50,function()skin.nextSet()end),
|
||||
prev= newButton(700,100,140,100,C.white,50,function()SKIN.prevSet()end),
|
||||
next= newButton(860,100,140,100,C.white,50,function()SKIN.nextSet()end),
|
||||
prev1= newButton(130,230,90,65,C.white,30,prevSkin(1)),
|
||||
prev2= newButton(270,230,90,65,C.white,30,prevSkin(2)),
|
||||
prev3= newButton(410,230,90,65,C.white,30,prevSkin(3)),
|
||||
@@ -286,9 +314,17 @@ local Widget={
|
||||
--spin6=newButton(825,540,90,65,C.white,30,nextDir(6)),--cannot rotate O
|
||||
spin7= newButton(970,540,90,65,C.white,30,nextDir(7)),
|
||||
|
||||
skinR= newButton(200,640,220,80,C.lightPurple,35,function()setting.skin={1,5,2,8,10,3,7}SFX.play("rotate")end),
|
||||
faceR= newButton(480,640,220,80,C.lightRed,35,function()setting.face={0,0,0,0,0,0,0}SFX.play("hold")end),
|
||||
back= newButton(1140,650,200,80,C.white,40,SCN.back),
|
||||
skinR= newButton(200,640,220,80,C.lightPurple,35,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),
|
||||
faceR= newButton(480,640,220,80,C.lightRed,35,function()
|
||||
for i=1,25 do
|
||||
setting.face[i]=0
|
||||
end
|
||||
SFX.play("hold")
|
||||
end),
|
||||
back= newButton(1140,650,200,80,C.white,40,BACK),
|
||||
},
|
||||
setting_touch={
|
||||
default=newButton(520,80,170,80,C.white,35,function()
|
||||
@@ -311,10 +347,9 @@ local Widget={
|
||||
sceneTemp.snap=sceneTemp.snap%6+1
|
||||
end),
|
||||
option= newButton(520,180,170,80,C.white,40,function()
|
||||
SCN.push()
|
||||
SCN.swapTo("setting_touchSwitch")
|
||||
SCN.goto("setting_touchSwitch")
|
||||
end),
|
||||
back= newButton(760,180,170,80,C.white,40,SCN.back),
|
||||
back= newButton(760,180,170,80,C.white,40,BACK),
|
||||
size= newSlider(450,265,460,14,40,nil,function()
|
||||
return VK_org[sceneTemp.sel].r/10-1
|
||||
end,
|
||||
@@ -350,42 +385,57 @@ local Widget={
|
||||
pro= newButton(1120,100, 240,80,C.white,35,function()for i=1,20 do VK_org[i].ava=true end end),
|
||||
hide= newSwitch(1170,200, 40,SETval("VKSwitch"),SETrev("VKSwitch")),
|
||||
track= newSwitch(1170,300, 35,SETval("VKTrack"),SETrev("VKTrack")),
|
||||
sound= newSwitch(850,400, 35,SETval("VKSound"),SETrev("VKSound")),
|
||||
sfx= newSlider(800,380,180,4,40,function()SFX.play("virtualKey",setting.VKSFX*.25)end,SETval("VKSFX"),SETsto("VKSFX")),
|
||||
vib= newSlider(800,460,180,2,40,function()VIB(setting.VKVIB)end,SETval("VKVIB"),SETsto("VKVIB")),
|
||||
icon= newSwitch(850,300, 40,SETval("VKIcon"),SETrev("VKIcon")),
|
||||
tkset= newButton(1120,400,240,80,C.white,32,function()
|
||||
SCN.push()
|
||||
SCN.swapTo("setting_trackSetting")
|
||||
tkset= newButton(1120,420,240,80,C.white,32,function()
|
||||
SCN.goto("setting_trackSetting")
|
||||
end,function()return not setting.VKTrack end),
|
||||
alpha= newSlider(840,490,400,10,40,nil,SETval("VKAlpha"),SETsto("VKAlpha")),
|
||||
back= newButton(1100,600,240,80,C.white,45,SCN.back),
|
||||
alpha= newSlider(840,540,400,10,40,nil,SETval("VKAlpha"),SETsto("VKAlpha")),
|
||||
back= newButton(1120,620,200,80,C.white,45,BACK),
|
||||
},
|
||||
setting_trackSetting={
|
||||
VKDodge=newSwitch(400,200, 35,SETval("VKDodge"),SETrev("VKDodge")),
|
||||
VKTchW= newSlider(140,310,1000,10,35,nil,SETval("VKTchW"),function(i)setting.VKTchW=i;setting.VKCurW=math.max(setting.VKCurW,i)end),
|
||||
VKCurW= newSlider(140,370,1000,10,35,nil,SETval("VKCurW"),function(i)setting.VKCurW=i;setting.VKTchW=math.min(setting.VKTchW,i)end),
|
||||
back= newButton(1080,600,240,80,C.white,45,SCN.back),
|
||||
back= newButton(1080,600,240,80,C.white,45,BACK),
|
||||
},
|
||||
setting_lang={
|
||||
chi= newButton(160,100,200,120,C.white,45,setLang(1),nil,"chi2"),
|
||||
chi2= newButton(380,100,200,120,C.white,45,setLang(2),nil,"eng"),
|
||||
eng= newButton(600,100,200,120,C.white,45,setLang(3),nil,"str"),
|
||||
str= newButton(820,100,200,120,C.white,45,setLang(4),nil,"back"),
|
||||
back= newButton(640,600,200,80,C.white,40,BACK,nil,"chi"),
|
||||
},
|
||||
help={
|
||||
his= newButton(1050,500,250,80,C.white,35,function()SCN.push()SCN.swapTo("history")end,nil,"back"),
|
||||
qq= newButton(1050,600,250,80,C.white,35,function()love.system.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end,function()return mobile end,"his"),
|
||||
back= newButton(640, 600,200,80,C.white,40,SCN.back,nil,"qq"),
|
||||
staff= newButton(980,500,150,80,C.white,32,function()SCN.goto("staff")end,nil,"his"),
|
||||
his= newButton(1160,500,150,80,C.white,32,function()SCN.goto("history")end,nil,"qq"),
|
||||
qq= newButton(980,600,150,80,C.white,32,function()love.system.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end,mobileHide,"back"),
|
||||
back= newButton(640,600,200,80,C.white,40,BACK,nil,"staff"),
|
||||
},
|
||||
staff={
|
||||
back= newButton(1160,630,150,80,C.white,40,BACK),
|
||||
},
|
||||
history={
|
||||
prev= newButton(1155,170,180,180,C.white,65,pressKey("up"),function()return sceneTemp[2]==1 end),
|
||||
next= newButton(1155,400,180,180,C.white,65,pressKey("down"),function()return sceneTemp[2]==#sceneTemp[1]-22 end),
|
||||
back= newButton(1155,600,180,90,C.white,40,SCN.back),
|
||||
next= newButton(1155,400,180,180,C.white,65,pressKey("down"),function()return sceneTemp[2]==#sceneTemp[1]end),
|
||||
back= newButton(1155,600,180,90,C.white,40,BACK),
|
||||
},
|
||||
stat={
|
||||
path= newButton(980,620,250,80,C.white,25,function()love.system.openURL(love.filesystem.getSaveDirectory())end,function()return mobile end,"back"),
|
||||
back= newButton(640,620,200,80,C.white,40,SCN.back,nil,"path"),
|
||||
path= newButton(980,620,250,80,C.white,25,function()love.system.openURL(love.filesystem.getSaveDirectory())end,mobileHide,"back"),
|
||||
back= newButton(640,620,200,80,C.white,40,BACK,nil,"path"),
|
||||
},
|
||||
}
|
||||
defSet,SETval,SETsto,SETrev,pressKey,setPen,prevSkin,nextSkin,nextDir,VKAdisp,VKAcode=nil
|
||||
for _,L in next,Widget do
|
||||
mobileHide,SETval,SETsto,SETrev=nil
|
||||
pressKey,setPen,prevSkin,nextSkin=nil
|
||||
nextDir,VKAdisp,VKAcode,setLang=nil
|
||||
newButton,newSwitch,newSlider=nil
|
||||
|
||||
for _,L in next,Widgets do
|
||||
for _,W in next,L do
|
||||
if W.next then
|
||||
W.next,L[W.next].prev=L[W.next],W
|
||||
end
|
||||
end
|
||||
end
|
||||
return Widget
|
||||
return Widgets
|
||||
16
conf.lua
16
conf.lua
@@ -1,12 +1,12 @@
|
||||
gameVersion="Alpha V0.8.17"
|
||||
gameVersion="Alpha V0.9.0"
|
||||
function love.conf(t)
|
||||
t.identity="Techmino"--SaveDir 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.accelerometerjoystick=false--ios/android加速度计=摇杆
|
||||
t.audio.mixwithsystem=true
|
||||
t.appendidentity=true--search files in source then in save directory
|
||||
t.accelerometerjoystick=false--accelerometer=joystick on ios/android
|
||||
if t.audio then t.audio.mixwithsystem=true end
|
||||
|
||||
local W=t.window
|
||||
W.title="Techmino "..gameVersion
|
||||
@@ -17,12 +17,12 @@ function love.conf(t)
|
||||
W.resizable=true
|
||||
W.fullscreentype="desktop"--"exclusive"
|
||||
W.fullscreen=false
|
||||
W.vsync=0--∞fps
|
||||
W.vsync=0--unlimit
|
||||
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.display=1--monitor ID
|
||||
W.highdpi=false--high-dpi mode for the window on a Retina display
|
||||
W.x,W.y=nil
|
||||
|
||||
local M=t.modules
|
||||
|
||||
73
document.txt
73
document.txt
@@ -1,14 +1,13 @@
|
||||
(ENG ver. below)
|
||||
游戏方法:
|
||||
系统会提供的一个个四联骨牌("方块",总共7种),玩家需要控制(左右移动和旋转90,180,270度),每填满场地的一行就会将其消除,根据消除方式会给对手攻击(如果有对手的话)
|
||||
活到最后或者完成目标即胜利.
|
||||
|
||||
旋转系统:
|
||||
使用Techmino专属旋转系统
|
||||
细节懒得写(?)
|
||||
使用Techmino专属旋转系统,细节懒得写(
|
||||
|
||||
spin判定:
|
||||
结合了不可移动判定和三角判定,是否为mini也与判定过程数据有关
|
||||
细节也懒得写(?)
|
||||
结合了不可移动判定和三角判定,是否为mini也与判定过程数据有关,细节也懒得写(
|
||||
|
||||
攻击系统:
|
||||
普通消除:
|
||||
@@ -17,7 +16,8 @@ spin判定:
|
||||
spin1/2/3攻击2/4/6,若mini则减半
|
||||
B2B:加1(techrash/spin1/spin2)或2(spin3)攻击
|
||||
B3B:在B2B效果之上消四再加1,spin再加0.5*消行数攻击,二者都+1额外抵挡
|
||||
连击:0,0,1,1,2,2,3,3,4,4,3,2,3,2,3,2,3…(后面都是2)
|
||||
堆楼连击:0,0,1,1,2,2,2,3,3,3,4,4,3, 之后都是2
|
||||
挖掘连击:0,0,1,1,2,2,3,3,4,4,4, 之后都是5
|
||||
特殊消除会增加B2B点数,让之后的特殊消除获得B2B(B3B)增益(详细说明见下文)
|
||||
半全消("下方有剩余方块"的全消,如果是I消1行则必须不剩余玩家放置的方块):伤害+2,额外抵挡+2
|
||||
全消:将上述伤害之和开根号,再+6~12(本局内递增)+2额外抵挡(注:本局消行数>4时会将B2B点数拉满)
|
||||
@@ -48,11 +48,68 @@ back to back(B2B)点数说明:
|
||||
1.随机:每次攻击后10%随机挑选一个玩家锁定
|
||||
2.最多徽章:攻击后或者锁定玩家死亡时锁定徽章最多的玩家
|
||||
3.最高:攻击后或者锁定玩家死亡时锁定场地最高的玩家(每秒刷新)
|
||||
4.反击:攻击所有锁定自己的玩家(攻击AOE),若未被任何人锁定则伏击随机玩家
|
||||
4.反击:攻击所有锁定自己的玩家(攻击AOE),若未被任何人锁定则攻击随机玩家(不锁定)
|
||||
坚持到最后的玩家就是胜利者.
|
||||
|
||||
自定义模式说明:
|
||||
玩家可以自由调整大多数参数(不包括上述各种游戏模式的特殊效果),也可以画一个场地去消除或者是作为提示模板来进行拼图模式.
|
||||
在拼图模式下,按功能键切换是否展示提示.其中打"X"的格子不允许有方块,空的格子可以是任何状态,普通的七种彩色方块必须颜色对应,垃圾行方块的为止只要有方块就可以,但是不能是空气,玩家拼出自己画的图后就会判定胜利.
|
||||
附录:
|
||||
ZXC的Ospin地图:XY0BCgAwCAIR7v9vHtUSt8AS0xKqgpnNGyXkrmFNePf6qi3BbQPrHT2Owxe6D66NeKi86dwB
|
||||
|
||||
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.
|
||||
|
||||
Rotation system:
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
Score system:
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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)
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
附录Appendix:
|
||||
ZXC's cool O-spin map:XY0BCgAwCAIR7v9vHtUSt8AS0xKqgpnNGyXkrmFNePf6qi3BbQPrHT2Owxe6D66NeKi86dwB
|
||||
BIN
image/BG/bg1.png
BIN
image/BG/bg1.png
Binary file not shown.
|
Before Width: | Height: | Size: 1.7 KiB |
BIN
image/BG/bg2.png
BIN
image/BG/bg2.png
Binary file not shown.
|
Before Width: | Height: | Size: 227 B |
BIN
image/mess/electric.png
Normal file
BIN
image/mess/electric.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
BIN
image/skin/brick(notypey).png
Normal file
BIN
image/skin/brick(notypey).png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
BIN
image/skin/classic(_).png
Normal file
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
BIN
image/skin/paper(mrz).png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
@@ -30,11 +30,11 @@ return{
|
||||
P:win("finish")
|
||||
end
|
||||
end,
|
||||
bg="game3",bgm="shining terminal",
|
||||
bg="aura",bgm="far",
|
||||
},
|
||||
slowMark=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
players[1].modeData.event="M7"
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
|
||||
@@ -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
|
||||
@@ -39,7 +38,7 @@ return{
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
setFont(55)
|
||||
@@ -53,6 +52,12 @@ return{
|
||||
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
|
||||
getRank=function(P)
|
||||
local W=P.modeData.event
|
||||
return W>100 and 4 or W>=80 and 3 or W>=50 and 2 or W>=20 and 1 or W>=5 and 0
|
||||
return
|
||||
W>=100 and 5 or
|
||||
W>=80 and 4 or
|
||||
W>=60 and 3 or
|
||||
W>=40 and 2 or
|
||||
W>=20 and 1 or
|
||||
W>=5 and 0
|
||||
end,
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
local int,rnd=math.floor,math.random
|
||||
local int,rnd,min=math.floor,math.random,math.min
|
||||
return{
|
||||
color=color.lightYellow,
|
||||
env={
|
||||
@@ -7,32 +7,31 @@ return{
|
||||
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
|
||||
@@ -48,7 +47,7 @@ return{
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
setFont(55)
|
||||
@@ -66,6 +65,12 @@ return{
|
||||
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
|
||||
getRank=function(P)
|
||||
local W=P.modeData.event
|
||||
return W>40 and 4 or W>=30 and 3 or W>=20 and 2 or W>=10 and 1 or W>=5 and 0
|
||||
return
|
||||
W>=50 and 5 or
|
||||
W>=40 and 4 or
|
||||
W>=30 and 3 or
|
||||
W>=20 and 2 or
|
||||
W>=10 and 1 or
|
||||
W>=5 and 0
|
||||
end,
|
||||
}
|
||||
@@ -11,13 +11,13 @@ return{
|
||||
env={
|
||||
drop=1e99,lock=1e99,
|
||||
hold=false,
|
||||
dropPiece=player.lose,
|
||||
dropPiece=function(P)P:lose()end,
|
||||
task=nil,
|
||||
bg="game1",bgm="newera",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
end,
|
||||
|
||||
@@ -4,14 +4,14 @@ return{
|
||||
env={
|
||||
drop=30,lock=45,
|
||||
visible="time",
|
||||
dropPiece=player.reach_winCheck,
|
||||
dropPiece=PLY.reach_winCheck,
|
||||
freshLimit=10,
|
||||
target=200,
|
||||
bg="glow",bgm="newera",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
mText(drawableText.line,-81,300)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
local gc=love.graphics
|
||||
local min=math.min
|
||||
return{
|
||||
color=color.magenta,
|
||||
@@ -6,14 +7,14 @@ return{
|
||||
fall=10,lock=60,
|
||||
center=false,
|
||||
visible="none",
|
||||
dropPiece=player.reach_winCheck,
|
||||
dropPiece=PLY.reach_winCheck,
|
||||
freshLimit=15,
|
||||
target=200,
|
||||
bg="rgb",bgm="secret7th",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
mText(drawableText.line,-81,300)
|
||||
@@ -21,6 +22,8 @@ return{
|
||||
setFont(75)
|
||||
mStr(P.stat.row,-81,220)
|
||||
mStr(P.stat.clear_S[4],-81,340)
|
||||
gc.setColor(1,1,1,.2)
|
||||
gc.draw(IMG.electric,-26,120,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,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
local gc=love.graphics
|
||||
local min=math.min
|
||||
return{
|
||||
color=color.red,
|
||||
@@ -7,14 +8,14 @@ return{
|
||||
center=false,ghost=false,
|
||||
dropFX=0,lockFX=0,
|
||||
visible="none",
|
||||
dropPiece=player.reach_winCheck,
|
||||
dropPiece=PLY.reach_winCheck,
|
||||
freshLimit=15,
|
||||
target=200,
|
||||
bg="rgb",bgm="secret8th",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
mText(drawableText.line,-81,300)
|
||||
@@ -22,6 +23,8 @@ return{
|
||||
setFont(75)
|
||||
mStr(P.stat.row,-81,220)
|
||||
mStr(P.stat.clear_S[4],-81,340)
|
||||
gc.setColor(1,1,1,.2)
|
||||
gc.draw(IMG.electric,-26,120,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,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
local gc=love.graphics
|
||||
local min=math.min
|
||||
return{
|
||||
color=color.green,
|
||||
@@ -5,14 +6,14 @@ return{
|
||||
drop=15,lock=45,
|
||||
freshLimit=10,
|
||||
visible="fast",
|
||||
dropPiece=player.reach_winCheck,
|
||||
dropPiece=PLY.reach_winCheck,
|
||||
freshLimit=10,
|
||||
target=200,
|
||||
bg="glow",bgm="reason",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
mText(drawableText.line,-81,300)
|
||||
@@ -20,6 +21,8 @@ return{
|
||||
setFont(75)
|
||||
mStr(P.stat.row,-81,220)
|
||||
mStr(P.stat.clear_S[4],-81,340)
|
||||
gc.setColor(1,1,1,.2)
|
||||
gc.draw(IMG.electric,-26,120,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,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
local gc=love.graphics
|
||||
local min=math.min
|
||||
return{
|
||||
color=color.red,
|
||||
@@ -8,14 +9,14 @@ return{
|
||||
center=false,ghost=false,
|
||||
dropFX=0,lockFX=0,
|
||||
visible="none",
|
||||
dropPiece=player.reach_winCheck,
|
||||
dropPiece=PLY.reach_winCheck,
|
||||
freshLimit=15,
|
||||
target=200,
|
||||
bg="rgb",bgm="secret7th",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
mText(drawableText.line,-81,300)
|
||||
@@ -23,6 +24,8 @@ return{
|
||||
setFont(75)
|
||||
mStr(P.stat.row,-81,220)
|
||||
mStr(P.stat.clear_S[4],-81,340)
|
||||
gc.setColor(1,1,1,.2)
|
||||
gc.draw(IMG.electric,-26,120,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,
|
||||
|
||||
@@ -27,7 +27,7 @@ return{
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
local P=players[1]
|
||||
local F=P.field
|
||||
for i=1,24 do
|
||||
@@ -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
|
||||
|
||||
@@ -25,7 +25,7 @@ return{
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
local P=players[1]
|
||||
local F=P.field
|
||||
for i=1,24 do
|
||||
@@ -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
|
||||
|
||||
@@ -29,7 +29,7 @@ return{
|
||||
},
|
||||
slowMark=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
setFont(75)
|
||||
|
||||
@@ -3,7 +3,7 @@ local int=math.floor
|
||||
return{
|
||||
color=color.white,
|
||||
env={
|
||||
dropPiece=player.reach_winCheck,
|
||||
dropPiece=PLY.reach_winCheck,
|
||||
},
|
||||
load=function()
|
||||
for i=1,#customID do
|
||||
@@ -12,14 +12,15 @@ return{
|
||||
end
|
||||
modeEnv._20G=modeEnv.drop==0
|
||||
modeEnv.oncehold=customSel[6]==1
|
||||
newPlayer(1,340,15)
|
||||
modeEnv.bag=preBag
|
||||
PLY.newPlayer(1,340,15)
|
||||
local L=modeEnv.opponent
|
||||
if L~=0 then
|
||||
modeEnv.target=nil
|
||||
if L<10 then
|
||||
newAIPlayer(2,965,360,.5,AITemplate("9S",2*L))
|
||||
PLY.newAIPlayer(2,965,360,.5,AITemplate("9S",2*L))
|
||||
else
|
||||
newAIPlayer(2,965,360,.5,AITemplate("CC",L-6,2+int((L-11)*.5),modeEnv.hold,15000+5000*(L-10)))
|
||||
PLY.newAIPlayer(2,965,360,.5,AITemplate("CC",L-6,2+int((L-11)*.5),modeEnv.hold,15000+5000*(L-10)))
|
||||
end
|
||||
end
|
||||
preField.h=20
|
||||
|
||||
@@ -31,15 +31,16 @@ return{
|
||||
end
|
||||
modeEnv._20G=modeEnv.drop==0
|
||||
modeEnv.oncehold=customSel[6]==1
|
||||
modeEnv.bag=preBag
|
||||
modeEnv.target=0
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
local L=modeEnv.opponent
|
||||
if L~=0 then
|
||||
modeEnv.target=nil
|
||||
if L<10 then
|
||||
newAIPlayer(2,965,360,.5,AITemplate("9S",2*L))
|
||||
PLY.newAIPlayer(2,965,360,.5,AITemplate("9S",2*L))
|
||||
else
|
||||
newAIPlayer(2,965,360,.5,AITemplate("CC",L-6,2+int((L-11)*.5),modeEnv.hold,15000+5000*(L-10)))
|
||||
PLY.newAIPlayer(2,965,360,.5,AITemplate("CC",L-6,2+int((L-11)*.5),modeEnv.hold,15000+5000*(L-10)))
|
||||
end
|
||||
end
|
||||
preField.h=20
|
||||
|
||||
@@ -41,7 +41,7 @@ return{
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
setFont(55)
|
||||
|
||||
@@ -41,7 +41,7 @@ return{
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
setFont(55)
|
||||
|
||||
@@ -20,7 +20,7 @@ return{
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
setFont(65)
|
||||
|
||||
@@ -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
|
||||
@@ -19,7 +19,7 @@ return{
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
setFont(65)
|
||||
|
||||
@@ -51,9 +51,9 @@ return{
|
||||
res[A+2]=7
|
||||
end
|
||||
|
||||
--give O when no Δ=0/give T when no Δ=1
|
||||
d=0--Δ=0
|
||||
A=0--Δ=1
|
||||
--give O when no d=0/give T when no d=1
|
||||
d=0--d=0 count
|
||||
A=0--d=1 count
|
||||
for x=2,10 do
|
||||
local _=height[x]-height[x-1]
|
||||
if _==0 then
|
||||
@@ -82,7 +82,7 @@ return{
|
||||
P:getNext(res[rnd(#res)])
|
||||
end
|
||||
end,
|
||||
target=100,dropPiece=player.reach_winCheck,
|
||||
target=100,dropPiece=PLY.reach_winCheck,
|
||||
next=1,hold=false,
|
||||
ospin=false,
|
||||
freshLimit=15,
|
||||
@@ -90,7 +90,7 @@ return{
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
setFont(70)
|
||||
|
||||
@@ -5,7 +5,7 @@ return{
|
||||
drop=20,lock=60,
|
||||
sequence="bag",
|
||||
bag={1,1,2,2,3,3,4,4,5,5,6,6},
|
||||
target=100,dropPiece=player.reach_winCheck,
|
||||
target=100,dropPiece=PLY.reach_winCheck,
|
||||
next=3,
|
||||
ospin=false,
|
||||
freshLimit=15,
|
||||
@@ -13,7 +13,7 @@ return{
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
setFont(70)
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
return{
|
||||
color=color.white,
|
||||
env={
|
||||
drop=60,lock=60,
|
||||
freshLimit=15,
|
||||
bg="none",bgm="way",
|
||||
},
|
||||
load=function()
|
||||
newPlayer(1,20,15)
|
||||
newPlayer(2,650,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
end,
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
return{
|
||||
color=color.white,
|
||||
env={
|
||||
drop=60,lock=60,
|
||||
freshLimit=15,
|
||||
bg="none",bgm="way",
|
||||
},
|
||||
load=function()
|
||||
newPlayer(1,20,100,.65)
|
||||
newPlayer(2,435,100,.65)
|
||||
newPlayer(3,850,100,.65)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
end,
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
return{
|
||||
color=color.white,
|
||||
env={
|
||||
drop=60,lock=60,
|
||||
freshLimit=15,
|
||||
bg="none",bgm="way",
|
||||
},
|
||||
load=function()
|
||||
newPlayer(1,25,160,.5)
|
||||
newPlayer(2,335,160,.5)
|
||||
newPlayer(3,645,160,.5)
|
||||
newPlayer(4,955,160,.5)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
end,
|
||||
}
|
||||
@@ -7,7 +7,7 @@ return{
|
||||
bg="glow",bgm="infinite",
|
||||
},
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
setFont(45)
|
||||
@@ -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
|
||||
|
||||
@@ -17,7 +17,7 @@ return{
|
||||
bg="glow",bgm="infinite",
|
||||
},
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
for _=1,8 do
|
||||
players[1]:garbageRise(13,1,rnd(10))
|
||||
end
|
||||
|
||||
@@ -26,7 +26,7 @@ return{
|
||||
pauseLimit=true,
|
||||
slowMark=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
setFont(45)
|
||||
|
||||
@@ -26,7 +26,7 @@ return{
|
||||
pauseLimit=true,
|
||||
slowMark=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
setFont(45)
|
||||
@@ -42,8 +42,8 @@ return{
|
||||
if L>=200 then
|
||||
local T=P.stat.time
|
||||
return
|
||||
T<=185 and 5 or
|
||||
T<=250 and 4 or
|
||||
T<=226 and 5 or
|
||||
T<=262 and 4 or
|
||||
3
|
||||
else
|
||||
return
|
||||
|
||||
@@ -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],
|
||||
@@ -47,7 +47,7 @@ return{
|
||||
},
|
||||
slowMark=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
setFont(45)
|
||||
|
||||
@@ -51,7 +51,7 @@ return{
|
||||
},
|
||||
slowMark=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
setFont(45)
|
||||
|
||||
@@ -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")
|
||||
@@ -37,7 +38,7 @@ return{
|
||||
color=color.lightGrey,
|
||||
env={
|
||||
noFly=true,
|
||||
mindas=5,minarr=1,
|
||||
das=5,arr=1,
|
||||
_20G=true,lock=12,
|
||||
wait=10,fall=10,
|
||||
dropPiece=score,
|
||||
@@ -47,7 +48,7 @@ return{
|
||||
},
|
||||
slowMark=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
setFont(45)
|
||||
|
||||
@@ -4,14 +4,14 @@ return{
|
||||
env={
|
||||
drop=60,lock=120,
|
||||
fall=10,
|
||||
target=100,dropPiece=player.reach_winCheck,
|
||||
target=100,dropPiece=PLY.reach_winCheck,
|
||||
freshLimit=15,
|
||||
ospin=false,
|
||||
bg="rgb",bgm="infinite",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
setFont(45)
|
||||
|
||||
@@ -4,14 +4,14 @@ return{
|
||||
env={
|
||||
drop=20,lock=60,
|
||||
fall=20,
|
||||
target=100,dropPiece=player.reach_winCheck,
|
||||
target=100,dropPiece=PLY.reach_winCheck,
|
||||
freshLimit=15,
|
||||
ospin=false,
|
||||
bg="rgb",bgm="infinite",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
setFont(45)
|
||||
|
||||
@@ -4,13 +4,13 @@ return{
|
||||
env={
|
||||
oncehold=false,
|
||||
drop=300,lock=1e99,
|
||||
target=100,dropPiece=player.reach_winCheck,
|
||||
target=100,dropPiece=PLY.reach_winCheck,
|
||||
ospin=false,
|
||||
bg="rgb",bgm="newera",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
setFont(45)
|
||||
@@ -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
|
||||
|
||||
@@ -5,53 +5,35 @@ local pc_lock={55,50,45,40,36,32,30}
|
||||
local pc_fall={18,16,14,12,10,9,8,7,6}
|
||||
local PCbase=require("parts/PCbase")
|
||||
local PClist=require("parts/PClist")
|
||||
local PCtype={[0]=1,2,1,3,2,3}
|
||||
|
||||
local function task_PC(P)
|
||||
local _
|
||||
P.modeData.counter=P.modeData.counter+1
|
||||
if P.modeData.counter==21 then
|
||||
local t=P.stat.pc%2
|
||||
local S=P.gameEnv.skin
|
||||
for i=1,4 do
|
||||
local r=freeRow.get(0)
|
||||
for j=1,10 do
|
||||
_=PCbase[4*t+i][j]
|
||||
r[j]=S[_]or 0
|
||||
end
|
||||
ins(P.field,1,r)
|
||||
ins(P.visTime,1,freeRow.get(20))
|
||||
end
|
||||
P.fieldBeneath=P.fieldBeneath+120
|
||||
P.curY=P.curY+4
|
||||
P:freshgho()
|
||||
if P.modeData.counter==26 then
|
||||
local base=PCbase[P.modeData.type]
|
||||
P:pushLine(base[rnd(#base)],P.modeData.symmetry)
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
local function newPC(P)
|
||||
local r=P.field;r=r[#r]
|
||||
if r then
|
||||
local r=P.field
|
||||
if r[1]then
|
||||
r=r[#r]
|
||||
local c=0
|
||||
for i=1,10 do if r[i]>0 then c=c+1 end end
|
||||
if c<5 then
|
||||
P:lose()
|
||||
end
|
||||
if c<5 then P:lose()end
|
||||
end
|
||||
if P.stat.piece%4==0 and #P.field==0 then
|
||||
P.modeData.event=P.modeData.event==0 and 1 or 0
|
||||
local r=rnd(#PClist)
|
||||
local f=P.modeData.event==0
|
||||
for i=1,4 do
|
||||
local b=PClist[r][i]
|
||||
if f then
|
||||
if b<3 then b=3-b
|
||||
elseif b<5 then b=7-b
|
||||
end
|
||||
end
|
||||
P:getNext(b)
|
||||
end
|
||||
if #P.field==0 then
|
||||
local type=PCtype[P.stat.pc]or rnd(2,3)
|
||||
local L=PClist[type][rnd(#PClist[1])]
|
||||
local symmetry=rnd()>.5
|
||||
P.modeData.type=type
|
||||
P.modeData.symmetry=symmetry
|
||||
P:pushNext(L,symmetry)
|
||||
P.modeData.counter=P.stat.piece==0 and 20 or 0
|
||||
TASK.new(task_PC,P)
|
||||
local s=P.stat.pc*.5
|
||||
P:newTask(task_PC)
|
||||
|
||||
local s=P.stat.pc*.25
|
||||
if int(s)==s and s>0 then
|
||||
P.gameEnv.drop=pc_drop[s]or 10
|
||||
P.gameEnv.lock=pc_lock[s]or 20
|
||||
@@ -80,7 +62,7 @@ return{
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
newPC(players[1])
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
@@ -94,11 +76,11 @@ return{
|
||||
getRank=function(P)
|
||||
local L=P.stat.pc
|
||||
return
|
||||
L>=50 and 5 or
|
||||
L>=40 and 4 or
|
||||
L>=30 and 3 or
|
||||
L>=100 and 5 or
|
||||
L>=70 and 4 or
|
||||
L>=40 and 3 or
|
||||
L>=20 and 2 or
|
||||
L>=10 and 1 or
|
||||
L>=1 and 0
|
||||
L>=2 and 0
|
||||
end,
|
||||
}
|
||||
@@ -1,52 +1,43 @@
|
||||
local rnd=math.random
|
||||
local ins=table.insert
|
||||
local PCbase=require("parts/PCbase")
|
||||
local PClist=require("parts/PClist")
|
||||
local PCtype={
|
||||
[0]=1,1,1,1,2,
|
||||
1,1,1,1,3,
|
||||
1,1,1,2,
|
||||
1,1,1,3,
|
||||
1,1,2,
|
||||
1,1,3,
|
||||
1,2,
|
||||
1,3,
|
||||
2,
|
||||
3,
|
||||
}
|
||||
local function task_PC(P)
|
||||
local _
|
||||
P.modeData.counter=P.modeData.counter+1
|
||||
if P.modeData.counter==21 then
|
||||
local t=P.stat.pc%2
|
||||
local S=P.gameEnv.skin
|
||||
for i=1,4 do
|
||||
local r=freeRow.get(0)
|
||||
for j=1,10 do
|
||||
_=PCbase[4*t+i][j]
|
||||
r[j]=S[_]or 0
|
||||
end
|
||||
ins(P.field,1,r)
|
||||
ins(P.visTime,1,freeRow.get(20))
|
||||
end
|
||||
P.fieldBeneath=P.fieldBeneath+120
|
||||
P.curY=P.curY+4
|
||||
P:freshgho()
|
||||
if P.modeData.counter==26 then
|
||||
local base=PCbase[P.modeData.type]
|
||||
P:pushLine(base[rnd(#base)],P.modeData.symmetry)
|
||||
return true
|
||||
end
|
||||
end
|
||||
local function newPC(P)
|
||||
local r=P.field;r=r[#r]
|
||||
if r then
|
||||
local r=P.field
|
||||
if r[1]then
|
||||
r=r[#r]
|
||||
local c=0
|
||||
for i=1,10 do if r[i]>0 then c=c+1 end end
|
||||
if c<5 then
|
||||
P:lose()
|
||||
end
|
||||
if c<5 then P:lose()end
|
||||
end
|
||||
if P.stat.piece%4==0 and #P.field==0 then
|
||||
P.modeData.event=P.modeData.event==0 and 1 or 0
|
||||
local r=rnd(#PClist)
|
||||
local f=P.modeData.event==0
|
||||
for i=1,4 do
|
||||
local b=PClist[r][i]
|
||||
if f then
|
||||
if b<3 then b=3-b
|
||||
elseif b<5 then b=7-b
|
||||
end
|
||||
end
|
||||
P:getNext(b)
|
||||
end
|
||||
if #P.field==0 then
|
||||
local type=PCtype[P.stat.pc]or rnd(2,3)
|
||||
local L=PClist[type][rnd(#PClist[1])]
|
||||
local symmetry=rnd()>.5
|
||||
P.modeData.type=type
|
||||
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{
|
||||
@@ -54,7 +45,7 @@ return{
|
||||
env={
|
||||
next=4,
|
||||
hold=false,
|
||||
drop=150,lock=150,
|
||||
drop=120,lock=180,
|
||||
fall=20,
|
||||
sequence="none",
|
||||
dropPiece=newPC,
|
||||
@@ -63,7 +54,7 @@ return{
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
newPC(players[1])
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
@@ -77,11 +68,11 @@ return{
|
||||
getRank=function(P)
|
||||
local L=P.stat.pc
|
||||
return
|
||||
L>=100 and 5 or
|
||||
L>=60 and 4 or
|
||||
L>=40 and 3 or
|
||||
L>=25 and 2 or
|
||||
L>=15 and 1 or
|
||||
L>=1 and 0
|
||||
L>=260 and 5 or
|
||||
L>=126 and 4 or
|
||||
L>=62 and 3 or
|
||||
L>=26 and 2 or
|
||||
L>=12 and 1 or
|
||||
L>=2 and 0
|
||||
end,
|
||||
}
|
||||
@@ -19,9 +19,9 @@ return{
|
||||
bg="game2",bgm="push",
|
||||
},
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
newAIPlayer(2,965,360,.5,AITemplate("CC",10,1,true,5000))
|
||||
garbageSpeed=1e99
|
||||
PLY.newPlayer(1,340,15)
|
||||
PLY.newAIPlayer(2,965,360,.5,AITemplate("CC",10,1,true,5000))
|
||||
game.garbageSpeed=1e99
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
end,
|
||||
|
||||
@@ -19,9 +19,9 @@ return{
|
||||
bg="game2",bgm="push",
|
||||
},
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
newAIPlayer(2,965,360,.5,AITemplate("CC",10,1,true,10000))
|
||||
garbageSpeed=1e99
|
||||
PLY.newPlayer(1,340,15)
|
||||
PLY.newAIPlayer(2,965,360,.5,AITemplate("CC",10,1,true,10000))
|
||||
game.garbageSpeed=1e99
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
end,
|
||||
@@ -32,10 +32,10 @@ return{
|
||||
if P.result=="WIN"then
|
||||
local T=P.stat.piece
|
||||
return
|
||||
T<=30 and 5 or
|
||||
T<=40 and 4 or
|
||||
T<=55 and 3 or
|
||||
T<=70 and 2 or
|
||||
T<=23 and 5 or
|
||||
T<=26 and 4 or
|
||||
T<=40 and 3 or
|
||||
T<=60 and 2 or
|
||||
1
|
||||
end
|
||||
end,
|
||||
|
||||
@@ -19,9 +19,9 @@ return{
|
||||
bg="game2",bgm="push",
|
||||
},
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
newAIPlayer(2,965,360,.5,AITemplate("CC",10,2,true,12600))
|
||||
garbageSpeed=1e99
|
||||
PLY.newPlayer(1,340,15)
|
||||
PLY.newAIPlayer(2,965,360,.5,AITemplate("CC",10,2,true,12600))
|
||||
game.garbageSpeed=1e99
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
end,
|
||||
@@ -32,10 +32,10 @@ return{
|
||||
if P.result=="WIN"then
|
||||
local T=P.stat.piece
|
||||
return
|
||||
T<=35 and 5 or
|
||||
T<=45 and 4 or
|
||||
T<=65 and 3 or
|
||||
T<=85 and 2 or
|
||||
T<=30 and 5 or
|
||||
T<=40 and 4 or
|
||||
T<=55 and 3 or
|
||||
T<=75 and 2 or
|
||||
1
|
||||
end
|
||||
end,
|
||||
|
||||
@@ -19,9 +19,9 @@ return{
|
||||
bg="game2",bgm="push",
|
||||
},
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
newAIPlayer(2,965,360,.5,AITemplate("CC",10,3,true,16260))
|
||||
garbageSpeed=1e99
|
||||
PLY.newPlayer(1,340,15)
|
||||
PLY.newAIPlayer(2,965,360,.5,AITemplate("CC",10,3,true,16260))
|
||||
game.garbageSpeed=1e99
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
end,
|
||||
@@ -32,10 +32,10 @@ return{
|
||||
if P.result=="WIN"then
|
||||
local T=P.stat.piece
|
||||
return
|
||||
T<=40 and 5 or
|
||||
T<=50 and 4 or
|
||||
T<=75 and 3 or
|
||||
T<=100 and 2 or
|
||||
T<=30 and 5 or
|
||||
T<=40 and 4 or
|
||||
T<=55 and 3 or
|
||||
T<=75 and 2 or
|
||||
1
|
||||
end
|
||||
end,
|
||||
|
||||
@@ -19,9 +19,9 @@ return{
|
||||
bg="game2",bgm="push",
|
||||
},
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
newAIPlayer(2,965,360,.5,AITemplate("CC",10,3,true,26000))
|
||||
garbageSpeed=1e99
|
||||
PLY.newPlayer(1,340,15)
|
||||
PLY.newAIPlayer(2,965,360,.5,AITemplate("CC",10,3,true,26000))
|
||||
game.garbageSpeed=1e99
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
end,
|
||||
@@ -32,10 +32,10 @@ return{
|
||||
if P.result=="WIN"then
|
||||
local T=P.stat.piece
|
||||
return
|
||||
T<=50 and 5 or
|
||||
T<=60 and 4 or
|
||||
T<=80 and 3 or
|
||||
T<=100 and 2 or
|
||||
T<=30 and 5 or
|
||||
T<=40 and 4 or
|
||||
T<=55 and 3 or
|
||||
T<=75 and 2 or
|
||||
1
|
||||
end
|
||||
end,
|
||||
|
||||
@@ -7,8 +7,8 @@ return{
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
newAIPlayer(2,965,360,.5,AITemplate("9S",3))
|
||||
PLY.newPlayer(1,340,15)
|
||||
PLY.newAIPlayer(2,965,360,.5,AITemplate("9S",3))
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
end,
|
||||
@@ -19,10 +19,10 @@ return{
|
||||
if P.result=="WIN"then
|
||||
local T=P.stat.time
|
||||
return
|
||||
T<=15 and 5 or
|
||||
T<=20 and 5 or
|
||||
T<=25 and 4 or
|
||||
T<=40 and 3 or
|
||||
T<=80 and 2 or
|
||||
T<=35 and 3 or
|
||||
T<=60 and 2 or
|
||||
1
|
||||
end
|
||||
end,
|
||||
|
||||
@@ -7,8 +7,8 @@ return{
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
newAIPlayer(2,965,360,.5,AITemplate("9S",5))
|
||||
PLY.newPlayer(1,340,15)
|
||||
PLY.newAIPlayer(2,965,360,.5,AITemplate("9S",5))
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
end,
|
||||
@@ -19,10 +19,10 @@ return{
|
||||
if P.result=="WIN"then
|
||||
local T=P.stat.time
|
||||
return
|
||||
T<=16 and 5 or
|
||||
T<=28 and 4 or
|
||||
T<=45 and 3 or
|
||||
T<=90 and 2 or
|
||||
T<=20 and 5 or
|
||||
T<=25 and 4 or
|
||||
T<=40 and 3 or
|
||||
T<=62 and 2 or
|
||||
1
|
||||
end
|
||||
end,
|
||||
|
||||
@@ -7,8 +7,8 @@ return{
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
newAIPlayer(2,965,360,.5,AITemplate("9S",7))
|
||||
PLY.newPlayer(1,340,15)
|
||||
PLY.newAIPlayer(2,965,360,.5,AITemplate("9S",7))
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
end,
|
||||
@@ -19,9 +19,9 @@ return{
|
||||
if P.result=="WIN"then
|
||||
local T=P.stat.time
|
||||
return
|
||||
T<=17 and 5 or
|
||||
T<=26 and 4 or
|
||||
T<=45 and 3 or
|
||||
T<=20 and 5 or
|
||||
T<=25 and 4 or
|
||||
T<=35 and 3 or
|
||||
T<=60 and 2 or
|
||||
1
|
||||
end
|
||||
|
||||
@@ -7,8 +7,8 @@ return{
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
newAIPlayer(2,965,360,.5,AITemplate("CC",9,2,true,26000))
|
||||
PLY.newPlayer(1,340,15)
|
||||
PLY.newAIPlayer(2,965,360,.5,AITemplate("CC",9,2,true,26000))
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
end,
|
||||
@@ -19,10 +19,10 @@ return{
|
||||
if P.result=="WIN"then
|
||||
local T=P.stat.time
|
||||
return
|
||||
T<=18 and 5 or
|
||||
T<=30 and 4 or
|
||||
T<=50 and 3 or
|
||||
T<=70 and 2 or
|
||||
T<=20 and 5 or
|
||||
T<=25 and 4 or
|
||||
T<=35 and 3 or
|
||||
T<=60 and 2 or
|
||||
1
|
||||
end
|
||||
end,
|
||||
|
||||
@@ -7,8 +7,8 @@ return{
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
newAIPlayer(2,965,360,.5,AITemplate("CC",10,3,true,50000))
|
||||
PLY.newPlayer(1,340,15)
|
||||
PLY.newAIPlayer(2,965,360,.5,AITemplate("CC",10,3,true,50000))
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
end,
|
||||
@@ -20,8 +20,8 @@ return{
|
||||
local T=P.stat.time
|
||||
return
|
||||
T<=20 and 5 or
|
||||
T<=30 and 4 or
|
||||
T<=45 and 3 or
|
||||
T<=25 and 4 or
|
||||
T<=35 and 3 or
|
||||
T<=60 and 2 or
|
||||
1
|
||||
end
|
||||
|
||||
44
modes/sprintPenta.lua
Normal file
44
modes/sprintPenta.lua
Normal file
@@ -0,0 +1,44 @@
|
||||
local gc=love.graphics
|
||||
local rnd=math.random
|
||||
return{
|
||||
color=color.green,
|
||||
env={
|
||||
drop=60,lock=60,
|
||||
sequence="bag",bag={8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25},
|
||||
target=40,dropPiece=PLY.reach_winCheck,
|
||||
bg="aura",bgm="race",
|
||||
},
|
||||
load=function()
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P)
|
||||
local dx,dy=P.fieldOff.x,P.fieldOff.y
|
||||
setFont(55)
|
||||
local r=40-P.stat.row
|
||||
if r<0 then r=0 end
|
||||
mStr(r,-81,265)
|
||||
if r<21 and r>0 then
|
||||
gc.setLineWidth(4)
|
||||
gc.setColor(1,r>10 and 0 or rnd(),.5)
|
||||
gc.line(dx,600-30*r+dy,300+dx,600-30*r+dy)
|
||||
end
|
||||
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[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
|
||||
return
|
||||
elseif T<40 then
|
||||
return 0
|
||||
end
|
||||
T=P.stat.time
|
||||
return
|
||||
T<=76 and 5 or
|
||||
T<=90 and 4 or
|
||||
T<=150 and 3 or
|
||||
T<=260 and 2 or
|
||||
1
|
||||
end,
|
||||
}
|
||||
@@ -4,11 +4,11 @@ return{
|
||||
color=color.cyan,
|
||||
env={
|
||||
drop=60,lock=60,
|
||||
target=10,dropPiece=player.reach_winCheck,
|
||||
target=10,dropPiece=PLY.reach_winCheck,
|
||||
bg="strap",bgm="race",
|
||||
},
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P)
|
||||
local dx,dy=P.fieldOff.x,P.fieldOff.y
|
||||
|
||||
@@ -4,11 +4,11 @@ return{
|
||||
color=color.orange,
|
||||
env={
|
||||
drop=60,lock=60,
|
||||
target=100,dropPiece=player.reach_winCheck,
|
||||
target=100,dropPiece=PLY.reach_winCheck,
|
||||
bg="strap",bgm="race",
|
||||
},
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P)
|
||||
local dx,dy=P.fieldOff.x,P.fieldOff.y
|
||||
@@ -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<=270 and 1 or
|
||||
T<=196 and 2 or
|
||||
T<=260 and 1 or
|
||||
0
|
||||
end,
|
||||
}
|
||||
@@ -4,11 +4,11 @@ return{
|
||||
color=color.lightGrey,
|
||||
env={
|
||||
drop=60,lock=60,
|
||||
target=1000,dropPiece=player.reach_winCheck,
|
||||
target=1000,dropPiece=PLY.reach_winCheck,
|
||||
bg="strap",bgm="push",
|
||||
},
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P)
|
||||
local dx,dy=P.fieldOff.x,P.fieldOff.y
|
||||
@@ -32,8 +32,8 @@ return{
|
||||
T<=626 and 5 or
|
||||
T<=1000 and 4 or
|
||||
T<=1400 and 3 or
|
||||
T<=2200 and 2 or
|
||||
T<=3000 and 1 or
|
||||
T<=2060 and 2 or
|
||||
T<=2600 and 1 or
|
||||
0
|
||||
end,
|
||||
}
|
||||
@@ -4,11 +4,11 @@ return{
|
||||
color=color.lightBlue,
|
||||
env={
|
||||
drop=60,lock=60,
|
||||
target=20,dropPiece=player.reach_winCheck,
|
||||
target=20,dropPiece=PLY.reach_winCheck,
|
||||
bg="strap",bgm="race",
|
||||
},
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P)
|
||||
local dx,dy=P.fieldOff.x,P.fieldOff.y
|
||||
@@ -31,8 +31,8 @@ return{
|
||||
return
|
||||
T<=13 and 5 or
|
||||
T<=18 and 4 or
|
||||
T<=45 and 3 or
|
||||
T<=80 and 2 or
|
||||
T<=32.6 and 3 or
|
||||
T<=62.6 and 2 or
|
||||
T<=126 and 1 or
|
||||
0
|
||||
end,
|
||||
|
||||
@@ -4,11 +4,11 @@ return{
|
||||
color=color.green,
|
||||
env={
|
||||
drop=60,lock=60,
|
||||
target=40,dropPiece=player.reach_winCheck,
|
||||
target=40,dropPiece=PLY.reach_winCheck,
|
||||
bg="strap",bgm="race",
|
||||
},
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P)
|
||||
local dx,dy=P.fieldOff.x,P.fieldOff.y
|
||||
@@ -31,8 +31,8 @@ return{
|
||||
return
|
||||
T<=26 and 5 or
|
||||
T<=32.6 and 4 or
|
||||
T<=40 and 3 or
|
||||
T<=62 and 2 or
|
||||
T<=52.6 and 3 or
|
||||
T<=92.9 and 2 or
|
||||
T<=183 and 1 or
|
||||
0
|
||||
end,
|
||||
|
||||
@@ -4,11 +4,11 @@ return{
|
||||
color=color.red,
|
||||
env={
|
||||
drop=60,lock=60,
|
||||
target=400,dropPiece=player.reach_winCheck,
|
||||
target=400,dropPiece=PLY.reach_winCheck,
|
||||
bg="strap",bgm="push",
|
||||
},
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P)
|
||||
local dx,dy=P.fieldOff.x,P.fieldOff.y
|
||||
@@ -30,10 +30,10 @@ return{
|
||||
local T=P.stat.time
|
||||
return
|
||||
T<=255 and 5 or
|
||||
T<=330 and 4 or
|
||||
T<=420 and 3 or
|
||||
T<=626 and 2 or
|
||||
T<=1000 and 1 or
|
||||
T<=326 and 4 or
|
||||
T<=462 and 3 or
|
||||
T<=555 and 2 or
|
||||
T<=626 and 1 or
|
||||
0
|
||||
end,
|
||||
}
|
||||
@@ -20,7 +20,7 @@ return{
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
setFont(65)
|
||||
|
||||
@@ -26,7 +26,7 @@ return{
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
setFont(65)
|
||||
|
||||
@@ -21,7 +21,7 @@ return{
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
PLY.newPlayer(1,340,15)
|
||||
end,
|
||||
mesDisp=function(P,dx,dy)
|
||||
setFont(65)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user