Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee99943ed9 | ||
|
|
60cbc83313 | ||
|
|
74bc1a2544 | ||
|
|
7b35d69be1 | ||
|
|
f29fc7081a | ||
|
|
882b841d3f | ||
|
|
3d22f5d8ca | ||
|
|
a3302ab2bc | ||
|
|
cdd5194108 | ||
|
|
40de030cae | ||
|
|
e1d92a166b | ||
|
|
99b55b72e0 | ||
|
|
08883b952f | ||
|
|
76fab86692 | ||
|
|
725eb4e26f | ||
|
|
8e5f6f8b7c | ||
|
|
c0149d5830 |
BIN
BGM/far.ogg
Normal file
BIN
BGM/how feeling.ogg
Normal file
BIN
SFX/spawn_1.ogg
Normal file
BIN
SFX/spawn_2.ogg
Normal file
BIN
SFX/spawn_3.ogg
Normal file
BIN
SFX/spawn_4.ogg
Normal file
BIN
SFX/spawn_5.ogg
Normal file
BIN
SFX/spawn_6.ogg
Normal file
BIN
SFX/spawn_7.ogg
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
@@ -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,82 +141,6 @@ function File.loadData()
|
||||
if s then
|
||||
setfenv(s,{})
|
||||
local S=s()
|
||||
if not S.version or S.version=="Alpha V0.8.15"then
|
||||
S.clear_S={S.clear_1,S.clear_2,S.clear_3,S.clear_4}
|
||||
S.clear={{},{},{},{},{},{},{}}
|
||||
local A,B,C,D=int(S.clear_1/7),int(S.clear_2/7),int(S.clear_3/7),S.clear_4
|
||||
for i=1,7 do
|
||||
S.clear[i][1]=A
|
||||
S.clear[i][2]=B
|
||||
S.clear[i][3]=C
|
||||
S.clear[i][4]=0
|
||||
end
|
||||
S.clear[7][4]=D
|
||||
for i=1,S.clear_1%7 do S.clear[i][1]=S.clear[i][1]+1 end
|
||||
for i=1,S.clear_2%7 do S.clear[i][2]=S.clear[i][2]+1 end
|
||||
for i=1,S.clear_3%7 do S.clear[i][3]=S.clear[i][3]+1 end
|
||||
S.clear_B={}
|
||||
for i=1,7 do
|
||||
S.clear_B[i]=S.clear[i][1]+S.clear[i][2]+S.clear[i][3]+S.clear[i][4]
|
||||
end
|
||||
|
||||
S.spin_S={S.spin_0,S.spin_1,S.spin_2,S.spin_3}
|
||||
S.spin={{},{},{},{},{},{},{}}
|
||||
A,B,C,D=int(S.spin_0/7),int(S.spin_1/7),int(S.spin_2/7),int(S.spin_3/7)
|
||||
for i=1,7 do
|
||||
S.spin[i][1]=A
|
||||
S.spin[i][2]=B
|
||||
S.spin[i][3]=C
|
||||
S.spin[i][4]=D
|
||||
end
|
||||
for i=1,S.spin_0%7 do S.spin[i][1]=S.spin[i][1]+1 end
|
||||
for i=1,S.spin_1%7 do S.spin[i][2]=S.spin[i][2]+1 end
|
||||
for i=1,S.spin_2%7 do S.spin[i][3]=S.spin[i][3]+1 end
|
||||
for i=1,S.spin_3%7 do S.spin[i][4]=S.spin[i][4]+1 end
|
||||
S.spin_B={}
|
||||
for i=1,7 do
|
||||
S.spin_B[i]=S.spin[i][1]+S.spin[i][2]+S.spin[i][3]+S.spin[i][4]
|
||||
end
|
||||
|
||||
S.hpc=S.c
|
||||
elseif S.version=="Alpha V0.8.16"then
|
||||
for i=1,6 do
|
||||
S.clear[7][4]=S.clear[7][4]+S.clear[i][4]
|
||||
S.clear[i][4]=0
|
||||
end
|
||||
end
|
||||
if not S.clear_B[8]then
|
||||
for i=1,7 do
|
||||
S.clear[i][5]=0
|
||||
S.spin[i][5]=0
|
||||
end
|
||||
for i=8,25 do
|
||||
S.clear[i]={0,0,0,0,0}
|
||||
S.spin[i]={0,0,0,0,0}
|
||||
S.spin_B[i]=0
|
||||
S.clear_B[i]=0
|
||||
end
|
||||
S.spin_S[5]=0
|
||||
S.clear_S[5]=0
|
||||
end
|
||||
if S.version=="Alpha V0.8.16"or S.version=="Alpha V0.8.17"or S.version=="Alpha V0.8.18"then
|
||||
setting.skin[3],setting.skin[4]=setting.skin[4],setting.skin[3]
|
||||
end
|
||||
if S.version=="Alpha V0.8.18"or S.version=="Alpha V0.8.19"then
|
||||
S.clear[3],S.clear[4]=S.clear[4],S.clear[3]
|
||||
S.spin[3],S.spin[4]=S.spin[4],S.spin[3]
|
||||
S.clear_B[3],S.clear_B[4]=S.clear_B[4],S.clear_B[3]
|
||||
S.spin_B[3],S.spin_B[4]=S.spin_B[4],S.spin_B[3]
|
||||
end
|
||||
if #modeRanks==76 then
|
||||
for i=1,4 do
|
||||
table.remove(modeRanks)
|
||||
end
|
||||
end
|
||||
if S.version~=gameVersion then
|
||||
S.version=gameVersion
|
||||
TEXT.show(text.newVersion,640,200,30,"fly",.3)
|
||||
end
|
||||
addToTable(S,stat)
|
||||
end
|
||||
end
|
||||
@@ -17,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
|
||||
@@ -1,13 +1,30 @@
|
||||
require("Zframework/toolfunc")
|
||||
color= require("Zframework/color")
|
||||
SHADER= require("Zframework/shader")
|
||||
VIB= require("Zframework/vib")
|
||||
SFX= require("Zframework/sfx")
|
||||
sysFX= require("Zframework/sysFX")
|
||||
BG= require("Zframework/bg")
|
||||
BGM= require("Zframework/bgm")
|
||||
VOC= require("Zframework/voice")
|
||||
LANG= require("Zframework/languages")
|
||||
FILE= require("Zframework/file")
|
||||
TEXT= require("Zframework/text")
|
||||
TASK= require("Zframework/task")
|
||||
IMG= require("Zframework/img")
|
||||
WIDGET= require("Zframework/widget")
|
||||
Widgets=require("Zframework/widgetList")
|
||||
LIGHT= require("Zframework/light")
|
||||
SCN= require("Zframework/scene")
|
||||
local Tmr=require("Zframework/timer")
|
||||
local Pnt=require("Zframework/paint")
|
||||
|
||||
local ms,kb,tc=love.mouse,love.keyboard,love.touch
|
||||
local gc,sys=love.graphics,love.system
|
||||
local Timer=love.timer.getTime
|
||||
local int,rnd,max,min=math.floor,math.random,math.max,math.min
|
||||
local abs=math.abs
|
||||
local rem=table.remove
|
||||
|
||||
kb.setKeyRepeat(true)
|
||||
kb.setTextInput(false)
|
||||
ms.setVisible(false)
|
||||
local ins,rem=table.insert,table.remove
|
||||
|
||||
local scr=scr
|
||||
local xOy=love.math.newTransform()
|
||||
@@ -17,10 +34,6 @@ local touchDist=nil
|
||||
joysticks={}
|
||||
|
||||
local devMode
|
||||
players={alive={},human=0}
|
||||
|
||||
local Tmr=require("timer")
|
||||
local Pnt=require("paint")
|
||||
|
||||
local infoCanvas=gc.newCanvas(108,27)
|
||||
local function updatePowerInfo()
|
||||
@@ -115,13 +128,15 @@ local keyDown,keyUp={},{}
|
||||
local gamepadDown,gamepadUp={},{}
|
||||
|
||||
function keyDown.load(k)
|
||||
if k=="s"then
|
||||
if k=="a"then
|
||||
sceneTemp.skip=true
|
||||
elseif k=="s"then
|
||||
marking=nil
|
||||
sceneTemp.skip=true
|
||||
end
|
||||
end
|
||||
function touchDown.load()
|
||||
if #tc.getTouches()>2 then
|
||||
function touchDown.load(id,x,y)
|
||||
if #tc.getTouches()==2 then
|
||||
sceneTemp.skip=true
|
||||
end
|
||||
end
|
||||
@@ -131,21 +146,18 @@ function mouseDown.intro(x,y,k)
|
||||
VOC.play("bye")
|
||||
SCN.back()
|
||||
else
|
||||
SCN.push()
|
||||
SCN.swapTo("main")
|
||||
SCN.goto("main")
|
||||
end
|
||||
end
|
||||
function touchDown.intro(id,x,y)
|
||||
SCN.push()
|
||||
SCN.swapTo("main")
|
||||
SCN.goto("main")
|
||||
end
|
||||
function keyDown.intro(key)
|
||||
if key=="escape"then
|
||||
VOC.play("bye")
|
||||
SCN.back()
|
||||
else
|
||||
SCN.push()
|
||||
SCN.swapTo("main")
|
||||
SCN.goto("main")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -153,17 +165,15 @@ local function onMode(x,y)
|
||||
local cam=mapCam
|
||||
x=(cam.x1-640+x)/cam.k1
|
||||
y=(cam.y1-360+y)/cam.k1
|
||||
local MM,R=modes,modeRanks
|
||||
for _=1,#MM do
|
||||
if R[_]then
|
||||
local M=MM[_]
|
||||
for name,M in next,Modes do
|
||||
if modeRanks[name]then
|
||||
local s=M.size
|
||||
if M.shape==1 then
|
||||
if x>M.x-s and x<M.x+s and y>M.y-s and y<M.y+s then return _ end
|
||||
if x>M.x-s and x<M.x+s and y>M.y-s and y<M.y+s then return name end
|
||||
elseif M.shape==2 then
|
||||
if abs(x-M.x)+abs(y-M.y)<s then return _ end
|
||||
if abs(x-M.x)+abs(y-M.y)<s then return name end
|
||||
elseif M.shape==3 then
|
||||
if(x-M.x)^2+(y-M.y)^2<s^2 then return _ end
|
||||
if(x-M.x)^2+(y-M.y)^2<s^2 then return name end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -193,20 +203,22 @@ end
|
||||
function mouseClick.mode(x,y,k)
|
||||
local cam=mapCam
|
||||
local _=cam.sel
|
||||
if not cam.sel or x<920 then
|
||||
local __=onMode(x,y)
|
||||
if _~=__ then
|
||||
if __ then
|
||||
if not _ or x<920 then
|
||||
local SEL=onMode(x,y)
|
||||
if _~=SEL then
|
||||
if SEL then
|
||||
SFX.play("click")
|
||||
cam.moving=true
|
||||
_=modes[__]
|
||||
_=Modes[SEL]
|
||||
cam.x=_.x*cam.k+180
|
||||
cam.y=_.y*cam.k
|
||||
cam.sel=__
|
||||
cam.sel=SEL
|
||||
else
|
||||
cam.sel=nil
|
||||
cam.x=cam.x-180
|
||||
end
|
||||
elseif _ then
|
||||
loadGame(_)
|
||||
end
|
||||
end
|
||||
cam.keyCtrl=false
|
||||
@@ -244,11 +256,9 @@ function keyDown.mode(key)
|
||||
else
|
||||
SCN.back()
|
||||
end
|
||||
elseif mapCam.sel==71 or mapCam.sel==72 then
|
||||
if key=="q"then
|
||||
SCN.push()SCN.swapTo("draw")
|
||||
elseif key=="e"then
|
||||
SCN.push()SCN.swapTo("custom")
|
||||
elseif mapCam.sel=="custom_clear" or mapCam.sel=="custom_puzzle" then
|
||||
if key=="e"then
|
||||
SCN.goto("custom")
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -304,6 +314,8 @@ function keyDown.custom(key)
|
||||
elseif sel==13 then
|
||||
BGM.play(customRange.bgm[customSel[sel]])
|
||||
end
|
||||
elseif key=="q"then
|
||||
SCN.goto("sequence")
|
||||
elseif #key==1 then
|
||||
local T=tonumber(key)
|
||||
if T and T>=1 and T<=5 then
|
||||
@@ -318,6 +330,54 @@ function keyDown.custom(key)
|
||||
end
|
||||
end
|
||||
|
||||
local minoKey={
|
||||
["1"]=1,["2"]=2,["3"]=3,["4"]=4,["5"]=5,["6"]=6,["7"]=7,
|
||||
z=1,s=2,j=3,l=4,t=5,o=6,i=7,
|
||||
p=10,q=11,f=12,e=13,u=15,
|
||||
v=16,w=17,x=18,r=21,y=22,n=23,h=24,
|
||||
}
|
||||
local minoKey2={
|
||||
["1"]=8,["2"]=9,["3"]=19,["4"]=20,["5"]=14,["7"]=25,
|
||||
z=8,s=9,t=14,j=19,l=20,i=25
|
||||
}
|
||||
function keyDown.sequence(key)
|
||||
local s=sceneTemp
|
||||
if type(key)=="number"then
|
||||
local C=s.cur+1
|
||||
ins(preBag,C,key)
|
||||
s.cur=C
|
||||
elseif #key==1 then
|
||||
local i=(kb.isDown("lctrl","lshift","lalt","rctrl","rshift","ralt")and minoKey2 or minoKey)[key]
|
||||
if i then
|
||||
local C=s.cur+1
|
||||
ins(preBag,C,i)
|
||||
s.cur=C
|
||||
end
|
||||
else
|
||||
if key=="left"then
|
||||
if s.cur>0 then s.cur=s.cur-1 end
|
||||
elseif key=="right"then
|
||||
if s.cur<#preBag then s.cur=s.cur+1 end
|
||||
elseif key=="backspace"then
|
||||
local C=s.cur
|
||||
if C>0 then
|
||||
rem(preBag,C)
|
||||
s.cur=C-1
|
||||
end
|
||||
elseif key=="escape"then
|
||||
SCN.back()
|
||||
elseif key=="delete"then
|
||||
if sceneTemp.sure>20 then
|
||||
preBag={}
|
||||
sceneTemp.cur=0
|
||||
sceneTemp.sure=0
|
||||
else
|
||||
sceneTemp.sure=50
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function mouseDown.draw(x,y,k)
|
||||
mouseMove.draw(x,y)
|
||||
end
|
||||
@@ -395,25 +455,13 @@ function keyDown.draw(key)
|
||||
end
|
||||
|
||||
function mouseDown.setting_sound(x,y,k)
|
||||
if x>780 and x<980 and y>470 and sceneTemp.jump==0 then
|
||||
sceneTemp.jump=10
|
||||
local t=Timer()-sceneTemp.last
|
||||
local s=sceneTemp
|
||||
if x>780 and x<980 and y>470 and s.jump==0 then
|
||||
s.jump=10
|
||||
local t=Timer()-s.last
|
||||
if t>1 then
|
||||
VOC.play((t<1.5 or t>15)and"doubt"or rnd()<.8 and"happy"or"egg")
|
||||
sceneTemp.last=Timer()
|
||||
if rnd()<.0626 then
|
||||
for i=1,#modes do
|
||||
local M=modes[i]
|
||||
for i=1,#M.unlock do
|
||||
local m=M.unlock[i]
|
||||
if not modeRanks[m]then
|
||||
modeRanks[m]=modes[m].score and 0 or 6
|
||||
end
|
||||
end
|
||||
end
|
||||
FILE.saveUnlock()
|
||||
TEXT.show("DEVMODE:UNLOCKALL",640,360,50,"stretch",.6)
|
||||
end
|
||||
s.last=Timer()
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -532,8 +580,7 @@ function keyDown.pause(key)
|
||||
elseif key=="escape"then
|
||||
resumeGame()
|
||||
elseif key=="s"then
|
||||
SCN.push()
|
||||
SCN.swapTo("setting_sound")
|
||||
SCN.goto("setting_sound")
|
||||
elseif key=="r"then
|
||||
TASK.clear("play")
|
||||
mergeStat(stat,players[1].stat)
|
||||
@@ -669,6 +716,66 @@ function touchDown.help(id,x,y)
|
||||
sceneTemp.pw=pw
|
||||
end
|
||||
|
||||
function keyDown.staff(key,RESET)
|
||||
if key=="escape"then
|
||||
SCN.back()
|
||||
elseif key=="\122"then
|
||||
if RESET or kb.isDown("\109")and kb.isDown("\114")then
|
||||
sceneTemp.ct=sceneTemp.ct+1
|
||||
if sceneTemp.ct==5 then
|
||||
TEXT.show("What are you up to?",640,200,40,"appear",.5)
|
||||
elseif sceneTemp.ct==10 then
|
||||
TEXT.show("Stop what you are doing.",640,200,40,"flicker",.5)
|
||||
elseif sceneTemp.ct==16 then
|
||||
TEXT.show("RESET ALL DATA?",640,200,40,"appear",.3,.2)
|
||||
elseif sceneTemp.ct==20 then
|
||||
TEXT.show("SURE?????",640,200,40,"beat",.3,.2)
|
||||
elseif sceneTemp.ct==26 then
|
||||
local L=love.filesystem.getDirectoryItems("")
|
||||
for i=1,#L do
|
||||
local s=L[i]
|
||||
if s:sub(-4)==".dat"then
|
||||
love.filesystem.remove(s)
|
||||
end
|
||||
end
|
||||
SFX.play("lock")
|
||||
SFX.play("clear_4")
|
||||
SFX.play("finesseError_long")
|
||||
SCN.back()
|
||||
TEXT.clear()
|
||||
end
|
||||
sceneTemp.v=-6.26
|
||||
marking=nil
|
||||
SFX.play("reach")
|
||||
end
|
||||
end
|
||||
end
|
||||
function touchDown.staff(id,x,y)
|
||||
if #tc.getTouches()==5 then
|
||||
keyDown.staff('\122',true)
|
||||
end
|
||||
end
|
||||
|
||||
function keyDown.stat(key)
|
||||
if key=="u"and kb.isDown("lshift","rshift")then
|
||||
touchDown.stat()
|
||||
end
|
||||
end
|
||||
function touchDown.stat(id,x,y)
|
||||
local s=sceneTemp
|
||||
s.count=s.count+1
|
||||
if rnd()<.0626 and s.count>26 then
|
||||
for name,M in next,Modes do
|
||||
if not modeRanks[name]then
|
||||
modeRanks[name]=M.score and 0 or 6
|
||||
end
|
||||
end
|
||||
FILE.saveUnlock()
|
||||
TEXT.show("DEV:\85\78\76\79\67\75\65\76\76",640,360,60,"stretch",.6)
|
||||
SFX.play("clear_4")
|
||||
end
|
||||
end
|
||||
|
||||
function wheelMoved.history(x,y)
|
||||
wheelScroll(y)
|
||||
end
|
||||
@@ -800,16 +907,11 @@ function love.keypressed(i)
|
||||
local W=WIDGET.sel
|
||||
if W then W:getInfo()end
|
||||
elseif i=="f3"then
|
||||
error("Techmino:挂了")
|
||||
assert(false,"Techmino:挂了")
|
||||
elseif i=="e"then
|
||||
for k,v in next,_G do
|
||||
print(k,v)
|
||||
end
|
||||
elseif i=="\122"then
|
||||
if kb.isDown("\109")and kb.isDown("\114")then
|
||||
marking=nil
|
||||
SFX.play("reach")
|
||||
end
|
||||
elseif WIDGET.sel then
|
||||
local W=WIDGET.sel
|
||||
if i=="left"then W.x=W.x-10
|
||||
@@ -901,9 +1003,10 @@ function love.lowmemory()
|
||||
collectgarbage()
|
||||
end
|
||||
function love.resize(w,h)
|
||||
love.timer.sleep(.26)
|
||||
scr.w,scr.h,scr.r=w,h,h/w
|
||||
scr.w,scr.h=w,h
|
||||
scr.r=h/w
|
||||
scr.rad=(w^2+h^2)^.5
|
||||
scr.dpi=gc.getDPIScale()
|
||||
if scr.r>=.5625 then
|
||||
scr.k=w/1280
|
||||
scr.x,scr.y=0,(h-w*9/16)*.5
|
||||
@@ -913,9 +1016,16 @@ function love.resize(w,h)
|
||||
end
|
||||
xOy=xOy:setTransformation(w*.5,h*.5,nil,scr.k,nil,640,360)
|
||||
BG.resize(w,h)
|
||||
|
||||
SHADER.warning:send("w",w*scr.dpi)
|
||||
SHADER.warning:send("h",h*scr.dpi)
|
||||
end
|
||||
function love.focus(f)
|
||||
if SCN.cur=="play"and not f and setting.autoPause then pauseGame()end
|
||||
if f then
|
||||
TASK.new(TICK.autoResize,{0})
|
||||
elseif SCN.cur=="play"and setting.autoPause then
|
||||
pauseGame()
|
||||
end
|
||||
end
|
||||
local scs={1,2,1,2,1,2,1,2,1,2,1.5,1.5,.5,2.5}
|
||||
local devColor={
|
||||
@@ -938,6 +1048,7 @@ function love.run()
|
||||
SCN.init("load")--Scene Launch
|
||||
marking=true
|
||||
return function()
|
||||
local _
|
||||
--EVENT
|
||||
PUMP()
|
||||
for N,a,b,c,d,e in POLL()do
|
||||
@@ -948,6 +1059,7 @@ function love.run()
|
||||
return 1
|
||||
end
|
||||
end
|
||||
|
||||
--UPDATE
|
||||
STEP()local dt=GETDelta()
|
||||
TASK.update()
|
||||
@@ -955,7 +1067,7 @@ function love.run()
|
||||
BG.update(dt)
|
||||
sysFX.update(dt)
|
||||
TEXT.update()
|
||||
local _=Tmr[SCN.cur]if _ then _(dt)end--Scene Updater
|
||||
_=Tmr[SCN.cur]if _ then _(dt)end--Scene Updater
|
||||
if SCN.swapping then SCN.swapUpdate()end--Scene swapping animation
|
||||
WIDGET.update()--Widgets animation
|
||||
|
||||
@@ -1019,76 +1131,11 @@ function love.run()
|
||||
if Timer()-lastFrame<.058 then WAIT(.01)end
|
||||
while Timer()-lastFrame<.0159 do WAIT(.001)end
|
||||
|
||||
--FRESH POWER
|
||||
--FRESH POWERINFO
|
||||
lastFrame=Timer()
|
||||
if Timer()-lastFreshPow>3 and setting.powerInfo and SCN.cur~="load"then
|
||||
updatePowerInfo()
|
||||
lastFreshPow=Timer()
|
||||
end
|
||||
end
|
||||
end
|
||||
function love.errorhandler(msg)
|
||||
local PUMP,POLL=love.event.pump,love.event.poll
|
||||
love.mouse.setVisible(true)
|
||||
love.audio.stop()
|
||||
local err={"Error:"..msg}
|
||||
local trace=debug.traceback("",2)
|
||||
local c=2
|
||||
for l in string.gmatch(trace,"(.-)\n")do
|
||||
if c>2 then
|
||||
if not string.find(l,"boot")then
|
||||
err[c]=string.gsub(l,"^\t*","")
|
||||
c=c+1
|
||||
end
|
||||
else
|
||||
err[2]="Traceback"
|
||||
c=3
|
||||
end
|
||||
end
|
||||
print(table.concat(err,"\n"),1,c-2)
|
||||
gc.reset()
|
||||
local CAP
|
||||
local function _(_)CAP=gc.newImage(_)end
|
||||
gc.captureScreenshot(_)
|
||||
gc.present()
|
||||
setting.sfx=setting.voc--only for error "voice" played with voice volume,not saved
|
||||
if SFX.list.error then SFX.play("error",.8)end
|
||||
local BGcolor=rnd()>.026 and{.3,.5,.9},{.62,.3,.926}
|
||||
local needDraw=true
|
||||
return function()
|
||||
PUMP()
|
||||
for E,a,b,c,d,e in POLL()do
|
||||
if E=="quit"or a=="escape"then
|
||||
destroyPlayers()
|
||||
return 1
|
||||
elseif E=="resize"then
|
||||
love.resize(a,b)
|
||||
needDraw=true
|
||||
elseif E=="focus"then
|
||||
needDraw=true
|
||||
end
|
||||
end
|
||||
if needDraw then
|
||||
gc.discard()
|
||||
gc.clear(BGcolor)
|
||||
gc.setColor(1,1,1)
|
||||
gc.push("transform")
|
||||
gc.replaceTransform(xOy)
|
||||
gc.draw(CAP,100,365,nil,512/CAP:getWidth(),288/CAP:getHeight())
|
||||
setFont(120)gc.print(":(",100,40)
|
||||
setFont(38)gc.printf(text.errorMsg,100,200,1280-100)
|
||||
setFont(20)
|
||||
gc.print(system.."-"..gameVersion,100,660)
|
||||
gc.print("scene:"..SCN.cur,400,660)
|
||||
gc.printf(err[1],626,360,1260-626)
|
||||
gc.print("TRACEBACK",626,426)
|
||||
for i=4,#err-2 do
|
||||
gc.print(err[i],626,370+20*i)
|
||||
end
|
||||
gc.pop()
|
||||
gc.present()
|
||||
needDraw=false
|
||||
end
|
||||
love.timer.sleep(.2)
|
||||
end
|
||||
end
|
||||
@@ -3,8 +3,8 @@
|
||||
--https://github.com/mattdesl/lwjgl-basics/wiki/2D-Pixel-Perfect-Shadows
|
||||
local gc=love.graphics
|
||||
local C=gc.clear
|
||||
local shadowMapShader=gc.newShader("shader/shadowMap.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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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,6 +372,8 @@ function Pnt.draw()
|
||||
gc.rectangle("line",30*sx-30,600-30*sy,30,30)
|
||||
end
|
||||
gc.translate(-200,-60)
|
||||
|
||||
--Pen
|
||||
local pen=sceneTemp.pen
|
||||
if pen>0 then
|
||||
gc.setLineWidth(13)
|
||||
@@ -346,10 +385,14 @@ function Pnt.draw()
|
||||
gc.line(575,470,625,520)
|
||||
gc.line(575,520,625,470)
|
||||
end
|
||||
|
||||
--Confirm reset
|
||||
if sceneTemp.sure>0 then
|
||||
gc.setColor(1,1,1,sceneTemp.sure*.02)
|
||||
gc.draw(drawableText.question,1040,430)
|
||||
end
|
||||
|
||||
--Block name
|
||||
setFont(40)
|
||||
local _
|
||||
for i=1,7 do
|
||||
@@ -359,6 +402,12 @@ function Pnt.draw()
|
||||
end
|
||||
end
|
||||
function Pnt.play()
|
||||
if marking then
|
||||
setFont(26)
|
||||
local t=Timer()
|
||||
gc.setColor(1,1,1,.2+.1*(sin(3*t)+sin(2.6*t)))
|
||||
mStr(text.marking,190,60+26*sin(t))
|
||||
end
|
||||
for p=1,#players do
|
||||
players[p]:draw()
|
||||
end
|
||||
@@ -416,13 +465,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}
|
||||
@@ -438,7 +501,7 @@ function Pnt.pause()
|
||||
gc.setColor(.15,.15,.15,_)
|
||||
gc.push("transform")
|
||||
gc.origin()
|
||||
gc.rectangle("fill",0,0,scr.w,scr.h)
|
||||
gc.rectangle("fill",0,0,scr.w*scr.dpi,scr.h*scr.dpi)
|
||||
gc.pop()
|
||||
|
||||
--Pause Info
|
||||
@@ -460,7 +523,7 @@ function Pnt.pause()
|
||||
mText(game.result and drawableText[game.result]or drawableText.pause,640,50-10*(5-sceneTemp.timer*.1)^1.5)
|
||||
|
||||
--Infos
|
||||
if frame>180 then
|
||||
if game.frame>180 then
|
||||
_=S.list
|
||||
setFont(26)
|
||||
for i=1,10 do
|
||||
@@ -470,7 +533,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")
|
||||
@@ -667,7 +730,7 @@ 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)
|
||||
@@ -684,6 +747,21 @@ function Pnt.help()
|
||||
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)
|
||||
358
Zframework/scene.lua
Normal file
@@ -0,0 +1,358 @@
|
||||
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.clears[1],S.clears[2],S.clears[3],S.clears[4]),
|
||||
format("(%d)/%d/%d/%d",S.spins[1],S.spins[2],S.spins[3],S.spins[4]),
|
||||
format("%d(+%d)/%d(%d)",S.b2b,S.b3b,S.pc,S.hpc),
|
||||
format("%d[%.2f%%]",S.extraPiece,100*max(1-S.extraRate/S.piece,0)),
|
||||
},
|
||||
|
||||
--from right-down, 60 degree each
|
||||
radar={
|
||||
(S.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
|
||||
local X1,X2,Y1,Y2={0,0,0,0},{0,0,0,0},{},{}
|
||||
for i=1,7 do
|
||||
local S,C=S.spin[i],S.clear[i]
|
||||
Y1[i]=S[1]+S[2]+S[3]+S[4]
|
||||
Y2[i]=C[1]+C[2]+C[3]+C[4]
|
||||
for j=1,4 do
|
||||
X1[j]=X1[j]+S[j]
|
||||
X2[j]=X2[j]+C[j]
|
||||
end
|
||||
end
|
||||
sceneTemp={
|
||||
count=0,
|
||||
chart={
|
||||
A1=S.spin,A2=S.clear,
|
||||
X1=X1,X2=X2,
|
||||
Y1=Y1,Y2=Y2,
|
||||
},
|
||||
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
|
||||
@@ -10,6 +10,7 @@ SFX.list={
|
||||
"virtualKey",
|
||||
"button","swipe",
|
||||
"ready","start","win","fail","collect",
|
||||
"spawn_1","spawn_2","spawn_3","spawn_4","spawn_5","spawn_6","spawn_7",
|
||||
"move","rotate","rotatekick","hold",
|
||||
"prerotate","prehold",
|
||||
"lock","drop","fall",
|
||||
@@ -38,6 +39,7 @@ end
|
||||
function SFX.play(s,v,pos)
|
||||
if setting.sfx==0 then return end
|
||||
local S=SFX.list[s]--source list
|
||||
if not S then return end
|
||||
local n=1
|
||||
while S[n]:isPlaying()do
|
||||
n=n+1
|
||||
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
@@ -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
@@ -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
@@ -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;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
#define PI 3.14
|
||||
#define PI 3.14159
|
||||
extern float xresolution;
|
||||
//sample from 1D vis-depth map
|
||||
float samp(vec2 coord,float r,Image u_texture){
|
||||
@@ -7,22 +7,22 @@ float samp(vec2 coord,float r,Image u_texture){
|
||||
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.;
|
||||
float r=length(norm);
|
||||
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(.3,1.,r);
|
||||
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)*.1
|
||||
+samp(vec2(tc.x-2.*blur,tc.y),r,texture)*.13
|
||||
+samp(vec2(tc.x-1.*blur,tc.y),r,texture)*.17
|
||||
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)*.2//The center tex coord,which gives us hard shadows.
|
||||
+samp(vec2(tc.x+1.*blur,tc.y),r,texture)*.17
|
||||
+samp(vec2(tc.x+2.*blur,tc.y),r,texture)*.13
|
||||
+samp(vec2(tc.x+3.*blur,tc.y),r,texture)*.1;
|
||||
+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
@@ -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.
|
||||
);
|
||||
}
|
||||
@@ -7,14 +7,14 @@ vec4 effect(vec4 color,Image texture,vec2 texture_coords,vec2 screen_coords){
|
||||
// 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)*.5;
|
||||
float r=(1.+norm.y)*0.5;
|
||||
|
||||
//sample from solid
|
||||
if(
|
||||
Texel(texture,(
|
||||
vec2(-r*sin(theta),-r*cos(theta))*.5+.5//coord of solid sampling
|
||||
vec2(-r*sin(theta),-r*cos(theta))*0.5+0.5//coord of solid sampling
|
||||
))
|
||||
.a>.1
|
||||
.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
@@ -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
@@ -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
|
||||
@@ -83,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)
|
||||
@@ -95,7 +95,7 @@ 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)
|
||||
@@ -1,7 +1,7 @@
|
||||
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={}
|
||||
@@ -18,13 +18,13 @@ function Tmr.load()
|
||||
elseif S.phase==4 then
|
||||
IMG.loadOne(S.cur)
|
||||
elseif S.phase==5 then
|
||||
local m=modes[S.cur]
|
||||
modes[S.cur]=require("modes/"..m[1])
|
||||
local M=modes[S.cur]
|
||||
M.saveFileName,M.id=m[1],m.id
|
||||
M.x,M.y,M.size,M.shape=m.x,m.y,m.size,m.shape
|
||||
M.unlock=m.unlock
|
||||
M.records=FILE.loadRecord(m[1])or M.score and{}
|
||||
local m=Modes[S.cur]--mode template
|
||||
local M=require("modes/"..m.name)--mode file
|
||||
Modes[m.name],Modes[S.cur]=M
|
||||
for k,v in next,m do
|
||||
M[k]=v
|
||||
end
|
||||
M.records=FILE.loadRecord(m.name)or M.score and{}
|
||||
-- M.icon=gc.newImage("image/modeIcon/"..m.icon..".png")
|
||||
-- M.icon=gc.newImage("image/modeIcon/custom.png")
|
||||
elseif S.phase==6 then
|
||||
@@ -68,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
|
||||
@@ -105,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
|
||||
@@ -142,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
|
||||
@@ -154,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
|
||||
@@ -198,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
|
||||
@@ -216,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
|
||||
@@ -231,11 +233,35 @@ function Tmr.play(dt)
|
||||
local P=players[p]
|
||||
P:update(dt)
|
||||
end
|
||||
if frame%120==0 then
|
||||
if game.frame%120==0 then
|
||||
if modeEnv.royaleMode then freshMostDangerous()end
|
||||
if marking and rnd()<.2 then
|
||||
TEXT.show(text.marking,rnd(162,scr.w-162),rnd(126,scr.h-200),40,"mark",.626)
|
||||
end--mark 2s each 10s
|
||||
end
|
||||
if P1.alive then
|
||||
if 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)
|
||||
@@ -283,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
@@ -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,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
|
||||
@@ -1,4 +1,6 @@
|
||||
mobileHide=(system=="Android"or system=="iOS")and function()return true end
|
||||
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
|
||||
@@ -86,44 +88,81 @@ local function VKAcode(n) return function()VK_org[n].ava=not VK_org[n].ava end e
|
||||
local function setLang(n) return function()LANG.set(n)setting.lang=n end end
|
||||
local newButton,newSwitch,newSlider=WIDGET.new.button,WIDGET.new.switch,WIDGET.new.slider
|
||||
|
||||
|
||||
local C=color
|
||||
local widgetList={
|
||||
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()SCN.push()SCN.swapTo("setting_lang")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,240,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,240,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,pressKey("1")),
|
||||
set2= newButton(640, 250,240,75, C.lightYellow, 35,pressKey("2")),
|
||||
set3= newButton(640, 340,240,75, C.lightYellow, 35,pressKey("3")),
|
||||
set4= newButton(640, 430,240,75, C.lightYellow, 35,pressKey("4")),
|
||||
set5= newButton(640, 520,240,75, C.lightYellow, 35,pressKey("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,200,40, C.lightGreen, 30,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,pressKey(1)),
|
||||
S= newButton(250, 440,90, 90,C.white, 50,pressKey(2)),
|
||||
J= newButton(350, 440,90, 90,C.white, 50,pressKey(3)),
|
||||
L= newButton(450, 440,90, 90,C.white, 50,pressKey(4)),
|
||||
T= newButton(550, 440,90, 90,C.white, 50,pressKey(5)),
|
||||
O= newButton(650, 440,90, 90,C.white, 50,pressKey(6)),
|
||||
I= newButton(750, 440,90, 90,C.white, 50,pressKey(7)),
|
||||
|
||||
Z5= newButton(150, 540,90, 90,C.white, 50,pressKey(8)),
|
||||
S5= newButton(250, 540,90, 90,C.white, 50,pressKey(9)),
|
||||
P= newButton(350, 540,90, 90,C.white, 50,pressKey(10)),
|
||||
Q= newButton(450, 540,90, 90,C.white, 50,pressKey(11)),
|
||||
F= newButton(550, 540,90, 90,C.white, 50,pressKey(12)),
|
||||
E= newButton(650, 540,90, 90,C.white, 50,pressKey(13)),
|
||||
T5= newButton(750, 540,90, 90,C.white, 50,pressKey(14)),
|
||||
U= newButton(850, 540,90, 90,C.white, 50,pressKey(15)),
|
||||
V= newButton(950, 540,90, 90,C.white, 50,pressKey(16)),
|
||||
W= newButton(150, 640,90, 90,C.white, 50,pressKey(17)),
|
||||
X= newButton(250, 640,90, 90,C.white, 50,pressKey(18)),
|
||||
J5= newButton(350, 640,90, 90,C.white, 50,pressKey(19)),
|
||||
L5= newButton(450, 640,90, 90,C.white, 50,pressKey(20)),
|
||||
R= newButton(550, 640,90, 90,C.white, 50,pressKey(21)),
|
||||
Y= newButton(650, 640,90, 90,C.white, 50,pressKey(22)),
|
||||
N= newButton(750, 640,90, 90,C.white, 50,pressKey(23)),
|
||||
H= newButton(850, 640,90, 90,C.white, 50,pressKey(24)),
|
||||
I5= newButton(950, 640,90, 90,C.white, 50,pressKey(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
|
||||
@@ -149,43 +188,44 @@ local widgetList={
|
||||
space= newButton(730, 360,120,120,C.grey, 65,setPen(-1)),
|
||||
clear= newButton(1200, 500,120,120,C.white, 40,pressKey("delete")),
|
||||
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),
|
||||
copy= newButton(920, 640,120,120,C.lightRed, 35,function()copyBoard()end),
|
||||
paste= newButton(1060, 640,120,120,C.lightBlue, 35,function()pasteBoard()end),
|
||||
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(1120,70,240,90,C.lightBlue,35,function()
|
||||
SCN.push()SCN.swapTo("setting_sound")
|
||||
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_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"),
|
||||
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"),
|
||||
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.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"),
|
||||
quickR= newSwitch(1050,320,35, SETval("quickR"), SETrev("quickR"), nil,"swap"),
|
||||
swap= newSwitch(1050,400,20, SETval("swap"), SETrev("swap"), nil,"fine"),
|
||||
fine= newSwitch(1050,480,20, SETval("fine"), SETrev("fine"), nil,"spawn"),
|
||||
spawn= newSwitch(1050,560,20, SETval("spawn"), SETrev("spawn"), nil,"back"),
|
||||
back= newButton(1140,650,200,80,C.white,40,BACK, nil,"graphic"),
|
||||
},
|
||||
setting_video={
|
||||
sound= newButton(200,80,240,80,C.lightCyan,35,function()SCN.swapTo("setting_sound")end, nil,"game"),
|
||||
@@ -201,31 +241,32 @@ local widgetList={
|
||||
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,"fullscreen"),
|
||||
fullscreen=newSwitch(1050,260,35,SETval("fullscreen"),function()
|
||||
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(1050,340,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,420,35,SETval("powerInfo"),function()
|
||||
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_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(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"),
|
||||
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(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"),
|
||||
@@ -241,10 +282,10 @@ local widgetList={
|
||||
_.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),
|
||||
@@ -273,9 +314,17 @@ local widgetList={
|
||||
--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,8,2,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()
|
||||
@@ -298,10 +347,9 @@ local widgetList={
|
||||
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,
|
||||
@@ -341,38 +389,41 @@ local widgetList={
|
||||
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,420,240,80,C.white,32,function()
|
||||
SCN.push()
|
||||
SCN.swapTo("setting_trackSetting")
|
||||
SCN.goto("setting_trackSetting")
|
||||
end,function()return not setting.VKTrack end),
|
||||
alpha= newSlider(840,540,400,10,40,nil,SETval("VKAlpha"),SETsto("VKAlpha")),
|
||||
back= newButton(1120,620,200,80,C.white,45,SCN.back),
|
||||
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,SCN.back,nil,"chi"),
|
||||
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,mobileHide,"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]end),
|
||||
back= newButton(1155,600,180,90,C.white,40,SCN.back),
|
||||
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,mobileHide,"back"),
|
||||
back= newButton(640,620,200,80,C.white,40,SCN.back,nil,"path"),
|
||||
back= newButton(640,620,200,80,C.white,40,BACK,nil,"path"),
|
||||
},
|
||||
}
|
||||
mobileHide,SETval,SETsto,SETrev=nil
|
||||
@@ -380,11 +431,11 @@ pressKey,setPen,prevSkin,nextSkin=nil
|
||||
nextDir,VKAdisp,VKAcode,setLang=nil
|
||||
newButton,newSwitch,newSlider=nil
|
||||
|
||||
for _,L in next,widgetList do
|
||||
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 widgetList
|
||||
return Widgets
|
||||
10
conf.lua
@@ -1,12 +1,12 @@
|
||||
gameVersion="Alpha V0.8.21"
|
||||
gameVersion="Alpha V0.9.1"
|
||||
function love.conf(t)
|
||||
t.identity="Techmino"--folder name
|
||||
t.identity="Techmino"--saving folder
|
||||
t.version="11.1"
|
||||
t.console=false
|
||||
t.gammacorrect=false
|
||||
t.appendidentity=true--search files in source before save directory
|
||||
t.appendidentity=true--search files in source then in save directory
|
||||
t.accelerometerjoystick=false--accelerometer=joystick on ios/android
|
||||
t.audio.mixwithsystem=true
|
||||
if t.audio then t.audio.mixwithsystem=true end
|
||||
|
||||
local W=t.window
|
||||
W.title="Techmino "..gameVersion
|
||||
@@ -17,7 +17,7 @@ function love.conf(t)
|
||||
W.resizable=true
|
||||
W.fullscreentype="desktop"--"exclusive"
|
||||
W.fullscreen=false
|
||||
W.vsync=0--infinite 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
|
||||
|
||||
72
document.txt
@@ -56,60 +56,60 @@ back to back(B2B)点数说明:
|
||||
在拼图模式下,按功能键切换是否展示提示.其中打"X"的格子不允许有方块,空的格子可以是任何状态,普通的七种彩色方块必须颜色对应,垃圾行方块的为止只要有方块就可以,但是不能是空气,玩家拼出自己画的图后就会判定胜利.
|
||||
|
||||
Gameplay:
|
||||
System will offer a series of tetrominoes ("Pieces". There are 7 types), and the player needs to control [them] (move left and right, rotate 90, 180 or 270 degrees), filling a row on the play field will clear it, attack will be sent depending on the type of the line clear (if there is an opponent)
|
||||
Survive till the last or complete the level's goal to win.
|
||||
System will offer a series of tetrominoes ("Pieces". There are 7 types), and the player needs to control [them] (move left and right, rotate 90, 180 or 270 degrees), filling a row on the play field will clear it, attack will be sent depending on the type of the line clear (if there is an opponent)
|
||||
Survive till the last or complete the level's goal to win.
|
||||
|
||||
Rotation system:
|
||||
Uses Techmino's custom rotation system. Too lazy to write the details
|
||||
Uses Techmino's custom rotation system. Too lazy to write the details
|
||||
|
||||
Spin detection:
|
||||
Combines immobile and 3-corner detection, and whether a spin is mini also depends on the data used for detection. Also too lazy to write the details
|
||||
Combines immobile and 3-corner detection, and whether a spin is mini also depends on the data used for detection. Also too lazy to write the details
|
||||
|
||||
Attack system:
|
||||
Regular line clears:
|
||||
Single/Double/Triple/Techrash sends 0.25/1.25/2.25/4
|
||||
Special line clears:
|
||||
Spin Single/Double/Triple sends 2/4/6, half if Mini
|
||||
B2B: +1 (Techrash/Spin Single/Spin Double) or +2 (Spin Triple)
|
||||
B2B2B/B3B: In addition to B2B, +1 if Techrash, +(0.5 * lines cleared) if Spin, and in both cases +1 additional blocking
|
||||
Wide Combo: 0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 3, then 2 afterwards
|
||||
Dig Combo: 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, then 5 afterwards
|
||||
Special line clears will increase B2B gauge, making later special line clears have B2B or B2B2B bonus (see below)
|
||||
Half Perfect Clear (a Perfect Clear "with blocks left below". If it's an I clearing 1 line, then the remaining blocks must not be player-placed): Attack +2, Extra Blocking +2
|
||||
Perfect Clear: square root all damage above, then +6 to +12 attack (increases within a round) and +2 extra blocking. (note: if lines cleared in this round >4, then B2B gauge will be filled)
|
||||
After calculating all above, the damage value will be rounded down then sent
|
||||
Regular line clears:
|
||||
Single/Double/Triple/Techrash sends 0.25/1.25/2.25/4
|
||||
Special line clears:
|
||||
Spin Single/Double/Triple sends 2/4/6, half if Mini
|
||||
B2B: +1 (Techrash/Spin Single/Spin Double) or +2 (Spin Triple)
|
||||
B2B2B/B3B: In addition to B2B, +1 if Techrash, +(0.5 * lines cleared) if Spin, and in both cases +1 additional blocking
|
||||
Wide Combo: 0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 3, then 2 afterwards
|
||||
Dig Combo: 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, then 5 afterwards
|
||||
Special line clears will increase B2B gauge, making later special line clears have B2B or B2B2B bonus (see below)
|
||||
Half Perfect Clear (a Perfect Clear "with blocks left below". If it's an I clearing 1 line, then the remaining blocks must not be player-placed): Attack +2, Extra Blocking +2
|
||||
Perfect Clear: square root all damage above, then +6 to +12 attack (increases within a round) and +2 extra blocking. (note: if lines cleared in this round >4, then B2B gauge will be filled)
|
||||
After calculating all above, the damage value will be rounded down then sent
|
||||
|
||||
Score system:
|
||||
The more impressive you play, the more score you get
|
||||
The more impressive you play, the more score you get
|
||||
|
||||
Attack delay:
|
||||
Attack from Doubles/Triples take effect the faster, then Techrash, Spins send rather slow attack, and high combos will send the slowest
|
||||
B2B or B2B2B, while they increase lines sent, they also increase the attack delay. Minis will greatly increase delay.
|
||||
Attack from Doubles/Triples take effect the faster, then Techrash, Spins send rather slow attack, and high combos will send the slowest
|
||||
B2B or B2B2B, while they increase lines sent, they also increase the attack delay. Minis will greatly increase delay.
|
||||
|
||||
Countering:
|
||||
When you send attack, if there is garbage in queue, extra blocking will be used first, then attack, countering the earliest attack at a 1:1 ratio.
|
||||
Unused extra blocking will be discarded, then remaining attack will be sent to your opponent.
|
||||
When you send attack, if there is garbage in queue, extra blocking will be used first, then attack, countering the earliest attack at a 1:1 ratio.
|
||||
Unused extra blocking will be discarded, then remaining attack will be sent to your opponent.
|
||||
|
||||
Back to Back (B2B) gauge:
|
||||
The B2B gauge ranges from 0 to 1,200. Special line clears are B2B if the gauge is >=40, B2B2B if >1,000.
|
||||
A regular line clear -250
|
||||
Spin Single/Double/Triple +50/100/180 (x40% if Mini)
|
||||
Techrash +100
|
||||
Spin without clearing lines +20, but gauge cannot exceed 1,000 with this method
|
||||
When gauge is above 1,000, a drop without clearing lines -40 (cannot drop below 1,000 with this method)
|
||||
The B2B gauge ranges from 0 to 1,200. Special line clears are B2B if the gauge is >=40, B2B2B if >1,000.
|
||||
A regular line clear -250
|
||||
Spin Single/Double/Triple +50/100/180 (x40% if Mini)
|
||||
Techrash +100
|
||||
Spin without clearing lines +20, but gauge cannot exceed 1,000 with this method
|
||||
When gauge is above 1,000, a drop without clearing lines -40 (cannot drop below 1,000 with this method)
|
||||
|
||||
Battle Royale modes:
|
||||
Many players play within one game (all opponents are bots, not real players). As players get eliminated, blocks fall faster, and garbage take effect faster, as well as rise faster. KO-ing another player grants you one badge plus all badge that player has, increasing your attack power.
|
||||
Players can select one of 4 attack modes:
|
||||
1. Random: Every time you attack, 10% chance to lock onto a random player.
|
||||
2. Badges: After you attack or when your target dies, lock onto the player with the most badges.
|
||||
3. KOs: After you attack or when your target dies, lock onto the player with the highest field. (This refreshes every second)
|
||||
4. Counter: attack all players locking onto yourself. Your attack will be sent to all of them. If you are not targetted, you attack a random player (not locking).
|
||||
The last survivor wins.
|
||||
Many players play within one game (all opponents are bots, not real players). As players get eliminated, blocks fall faster, and garbage take effect faster, as well as rise faster. KO-ing another player grants you one badge plus all badge that player has, increasing your attack power.
|
||||
Players can select one of 4 attack modes:
|
||||
1. Random: Every time you attack, 10% chance to lock onto a random player.
|
||||
2. Badges: After you attack or when your target dies, lock onto the player with the most badges.
|
||||
3. KOs: After you attack or when your target dies, lock onto the player with the highest field. (This refreshes every second)
|
||||
4. Counter: attack all players locking onto yourself. Your attack will be sent to all of them. If you are not targetted, you attack a random player (not locking).
|
||||
The last survivor wins.
|
||||
|
||||
Custom mode:
|
||||
You can freely adjust most parameters (not including special effects of other game modes), and you can also draw a field to clear or make a template to build.
|
||||
In build (puzzle) mode, you can toggle template display with Function key. Cells with a X cannot have blocks; empty cells can be in any state; regular colored cells have to be made of the corresponding block; garbage-colored cells can be any block but not air. Once you make the shape, you will win.
|
||||
You can freely adjust most parameters (not including special effects of other game modes), and you can also draw a field to clear or make a template to build.
|
||||
In build (puzzle) mode, you can toggle template display with Function key. Cells with a X cannot have blocks; empty cells can be in any state; regular colored cells have to be made of the corresponding block; garbage-colored cells can be any block but not air. Once you make the shape, you will win.
|
||||
|
||||
附录Appendix:
|
||||
ZXC's cool O-spin map:XY0BCgAwCAIR7v9vHtUSt8AS0xKqgpnNGyXkrmFNePf6qi3BbQPrHT2Owxe6D66NeKi86dwB
|
||||
BIN
image/BG/bg1.png
|
Before Width: | Height: | Size: 1.7 KiB |
BIN
image/BG/bg2.png
|
Before Width: | Height: | Size: 227 B |
BIN
image/mess/electric.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
image/skin/WTF.png
Normal file
|
After Width: | Height: | Size: 91 B |
BIN
image/skin/brick(notypey).png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
image/skin/classic(_).png
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
BIN
image/skin/paper(mrz).png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
108
main.lua
@@ -2,8 +2,14 @@
|
||||
Techmino is my first "huge project"
|
||||
optimization is welcomed if you also love tetromino game
|
||||
]]
|
||||
|
||||
--Global Setting & Vars
|
||||
math.randomseed(os.time()*626)
|
||||
--Global vars
|
||||
love.keyboard.setKeyRepeat(true)
|
||||
love.keyboard.setTextInput(false)
|
||||
love.mouse.setVisible(false)
|
||||
|
||||
function NULL()end
|
||||
system=love.system.getOS()
|
||||
game={}
|
||||
mapCam={
|
||||
@@ -20,52 +26,42 @@ mapCam={
|
||||
--for auto zooming when enter/leave scene
|
||||
}
|
||||
scr={x=0,y=0,w=0,h=0,rad=0,k=1}--wid,hei,radius,scale K
|
||||
|
||||
customSel={1,22,1,1,7,3,1,1,8,4,1,1,1}
|
||||
preField={h=20}for i=1,20 do preField[i]={0,0,0,0,0,0,0,0,0,0}end
|
||||
function NULL()end
|
||||
preBag={}
|
||||
|
||||
players={alive={},human=0}
|
||||
--blockSkin,blockSkinMini={},{}--redefined in SKIN.change
|
||||
|
||||
require("Zframework")--load Zframework
|
||||
|
||||
--Load modules
|
||||
setFont=require("parts/setfont")
|
||||
color=require("parts/color")
|
||||
blocks=require("parts/mino")
|
||||
SHADER=require("parts/shader")
|
||||
AITemplate=require("parts/AITemplate")
|
||||
freeRow=require("parts/freeRow")
|
||||
tickEvent=require("parts/tickEvent")
|
||||
blocks= require("parts/mino")
|
||||
AITemplate= require("parts/AITemplate")
|
||||
freeRow= require("parts/freeRow")
|
||||
|
||||
require("parts/list")
|
||||
require("toolfunc")
|
||||
require("texture")
|
||||
require("parts/gametoolfunc")
|
||||
require("parts/texture")
|
||||
require("parts/default_data")
|
||||
|
||||
SCN=require("scene")
|
||||
VIB=require("parts/vib")
|
||||
SFX=require("parts/sfx")
|
||||
sysFX=require("parts/sysFX")
|
||||
BGM=require("parts/bgm")
|
||||
VOC=require("parts/voice")
|
||||
SKIN=require("parts/skin")
|
||||
LANG=require("parts/languages")
|
||||
FILE=require("parts/file")
|
||||
TEXT=require("parts/text")
|
||||
TASK=require("parts/task")
|
||||
BG=require("parts/bg")
|
||||
IMG=require("parts/img")
|
||||
WIDGET=require("parts/widget")
|
||||
LIGHT=require("parts/light")
|
||||
SKIN= require("parts/skin")
|
||||
PLY= require("parts/player")
|
||||
AIfunc= require("parts/ai")
|
||||
Modes= require("parts/modes")
|
||||
TICK= require("parts/tick")
|
||||
|
||||
require("parts/modes")
|
||||
require("default_data")
|
||||
require("parts/ai")
|
||||
require("player")
|
||||
widgetList=require("widgetList")
|
||||
require("callback")
|
||||
|
||||
--load files & settings
|
||||
modeRanks={sprint_10=0}
|
||||
|
||||
local fs=love.filesystem
|
||||
if fs.getInfo("keymap.dat")then fs.remove("keymap.dat")end
|
||||
if fs.getInfo("setting.dat")then fs.remove("setting.dat")end
|
||||
|
||||
if fs.getInfo("setting.dat")then FILE.loadSetting()
|
||||
if fs.getInfo("settings.dat")then
|
||||
FILE.loadSetting()
|
||||
else
|
||||
-- firstRun=true
|
||||
if system=="Android"or system=="iOS" then
|
||||
@@ -81,4 +77,48 @@ if setting.fullscreen then love.window.setFullscreen(true)end
|
||||
if fs.getInfo("unlock.dat")then FILE.loadUnlock()end
|
||||
if fs.getInfo("data.dat")then FILE.loadData()end
|
||||
if fs.getInfo("key.dat")then FILE.loadKeyMap()end
|
||||
if fs.getInfo("virtualkey.dat")then FILE.loadVK()end
|
||||
if fs.getInfo("virtualkey.dat")then FILE.loadVK()end
|
||||
|
||||
--update data file
|
||||
S=stat
|
||||
S.clear_B,S.clear_S=nil
|
||||
if not S.clear[1][5]then
|
||||
for i=1,7 do
|
||||
S.clear[i][5]=0
|
||||
S.spin[i][5]=0
|
||||
end
|
||||
for i=8,25 do
|
||||
S.clear[i]={0,0,0,0,0}
|
||||
S.spin[i]={0,0,0,0,0}
|
||||
end
|
||||
end
|
||||
if not S.off then
|
||||
S.off=S.recv-S.pend
|
||||
end
|
||||
if S.clear[1][4]>0 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
|
||||
while #modeRanks>73 do
|
||||
table.remove(modeRanks)
|
||||
end
|
||||
if modeRanks[73]==6 then modeRanks[73]=0 end
|
||||
if modeRanks[1]then--rename key of modeRanks
|
||||
local L=modeRanks
|
||||
for i=1,#L do
|
||||
L[Modes[i].name],L[i]=L[i]
|
||||
end
|
||||
end
|
||||
if setting.skin[10]==5 then
|
||||
setting.skin[10],setting.skin[11]=1,5
|
||||
end
|
||||
if S.version~=gameVersion then
|
||||
if S.version then
|
||||
setting.spawn=true
|
||||
end
|
||||
S.version=gameVersion
|
||||
TEXT.show(text.newVersion,640,200,30,"fly",.3)
|
||||
end
|
||||
S=nil
|
||||
@@ -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)
|
||||
@@ -45,7 +45,7 @@ return{
|
||||
mStr(P.modeData.event,-81,110)
|
||||
setFont(75)
|
||||
mStr(P.stat.row,-81,220)
|
||||
mStr(P.stat.clear_S[4],-81,340)
|
||||
mStr(P.stat.clears[4],-81,340)
|
||||
end,
|
||||
score=function(P)return{P.modeData.point,P.stat.score}end,
|
||||
scoreDisp=function(D)return sectionName[int(D[1]*.1)+1].." "..D[2]end,
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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,21 +4,21 @@ 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)
|
||||
mText(drawableText.techrash,-81,420)
|
||||
setFont(75)
|
||||
mStr(P.stat.row,-81,220)
|
||||
mStr(P.stat.clear_S[4],-81,340)
|
||||
mStr(P.stat.clears[4],-81,340)
|
||||
end,
|
||||
score=function(P)return{min(P.stat.row or 200),P.stat.time}end,
|
||||
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
local gc=love.graphics
|
||||
local min=math.min
|
||||
return{
|
||||
color=color.magenta,
|
||||
@@ -6,21 +7,23 @@ 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)
|
||||
mText(drawableText.techrash,-81,420)
|
||||
setFont(75)
|
||||
mStr(P.stat.row,-81,220)
|
||||
mStr(P.stat.clear_S[4],-81,340)
|
||||
mStr(P.stat.clears[4],-81,340)
|
||||
gc.setColor(1,1,1,.2)
|
||||
gc.draw(IMG.electric,-26,120,0,2.6)
|
||||
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,21 +8,23 @@ 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)
|
||||
mText(drawableText.techrash,-81,420)
|
||||
setFont(75)
|
||||
mStr(P.stat.row,-81,220)
|
||||
mStr(P.stat.clear_S[4],-81,340)
|
||||
mStr(P.stat.clears[4],-81,340)
|
||||
gc.setColor(1,1,1,.2)
|
||||
gc.draw(IMG.electric,-26,120,0,2.6)
|
||||
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,21 +6,23 @@ 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)
|
||||
mText(drawableText.techrash,-81,420)
|
||||
setFont(75)
|
||||
mStr(P.stat.row,-81,220)
|
||||
mStr(P.stat.clear_S[4],-81,340)
|
||||
mStr(P.stat.clears[4],-81,340)
|
||||
gc.setColor(1,1,1,.2)
|
||||
gc.draw(IMG.electric,-26,120,0,2.6)
|
||||
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,21 +9,23 @@ 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)
|
||||
mText(drawableText.techrash,-81,420)
|
||||
setFont(75)
|
||||
mStr(P.stat.row,-81,220)
|
||||
mStr(P.stat.clear_S[4],-81,340)
|
||||
mStr(P.stat.clears[4],-81,340)
|
||||
gc.setColor(1,1,1,.2)
|
||||
gc.draw(IMG.electric,-26,120,0,2.6)
|
||||
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)
|
||||
if preBag[1]then modeEnv.bag=preBag end
|
||||
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
|
||||
if preBag[1]then modeEnv.bag=preBag end
|
||||
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)
|
||||
|
||||
@@ -10,13 +10,19 @@ return{
|
||||
if not P.next[1] then
|
||||
local height=freeRow.get(0)
|
||||
local max=#P.field
|
||||
for x=1,10 do
|
||||
local h=max
|
||||
while P.field[h][x]==0 and h>1 do
|
||||
h=h-1
|
||||
if max>0 then
|
||||
for x=1,10 do
|
||||
local h=max
|
||||
while P.field[h][x]==0 and h>1 do
|
||||
h=h-1
|
||||
end
|
||||
height[x]=h
|
||||
end--get heights
|
||||
else
|
||||
for x=1,10 do
|
||||
height[x]=0
|
||||
end
|
||||
height[x]=h
|
||||
end--get heights
|
||||
end
|
||||
height[11]=999
|
||||
|
||||
local res={1,1,2,2,3,4}
|
||||
@@ -27,9 +33,11 @@ return{
|
||||
end
|
||||
if d<40 or P.stat.row>2*42 then
|
||||
A=#res+1
|
||||
for i=A,A+5 do
|
||||
res[i]=1
|
||||
res[i+6]=2
|
||||
for i=1,4 do
|
||||
res[A]=1
|
||||
res[A+1]=2
|
||||
res[A+2]=6
|
||||
A=A+3
|
||||
end
|
||||
goto END
|
||||
end
|
||||
@@ -82,7 +90,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 +98,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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
@@ -63,16 +63,16 @@ return{
|
||||
getRank=function(P)
|
||||
local S=P.modeData.point
|
||||
if S==500 then
|
||||
local L=P.stat.clear_S[4]
|
||||
local T=P.stat.time
|
||||
return
|
||||
L>=30 and 5 or
|
||||
L>=25 and 4 or
|
||||
3
|
||||
T<=118 and 5 or
|
||||
T<=148 and 4 or
|
||||
T<=183 and 3 or
|
||||
2
|
||||
else
|
||||
return
|
||||
S>=426 and 3 or
|
||||
S>=326 and 2 or
|
||||
S>=226 and 1 or
|
||||
S>=300 and 2 or
|
||||
S>=100 and 1 or
|
||||
S>=50 and 0
|
||||
end
|
||||
end,
|
||||
|
||||
@@ -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)
|
||||
@@ -67,7 +67,7 @@ return{
|
||||
getRank=function(P)
|
||||
local S=P.modeData.point
|
||||
if S==500 then
|
||||
local L=P.stat.clear_S[4]
|
||||
local L=P.stat.clears[4]
|
||||
return
|
||||
L>=30 and 5 or
|
||||
L>=25 and 4 or
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -31,7 +31,7 @@ local function newPC(P)
|
||||
P.modeData.symmetry=symmetry
|
||||
P:pushNext(L,symmetry)
|
||||
P.modeData.counter=P.stat.piece==0 and 20 or 0
|
||||
TASK.new(task_PC,P)
|
||||
P:newTask(task_PC)
|
||||
|
||||
local s=P.stat.pc*.25
|
||||
if int(s)==s and s>0 then
|
||||
@@ -62,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)
|
||||
|
||||
@@ -37,7 +37,7 @@ local function newPC(P)
|
||||
P.modeData.symmetry=symmetry
|
||||
P:pushNext(L,symmetry)
|
||||
P.modeData.counter=P.stat.piece==0 and 20 or 0
|
||||
TASK.new(task_PC,P)
|
||||
P:newTask(task_PC)
|
||||
end
|
||||
end
|
||||
return{
|
||||
@@ -54,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)
|
||||
|
||||
@@ -19,8 +19,8 @@ return{
|
||||
bg="game2",bgm="push",
|
||||
},
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
newAIPlayer(2,965,360,.5,AITemplate("CC",10,1,true,5000))
|
||||
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)
|
||||
|
||||
@@ -19,8 +19,8 @@ return{
|
||||
bg="game2",bgm="push",
|
||||
},
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
newAIPlayer(2,965,360,.5,AITemplate("CC",10,1,true,10000))
|
||||
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)
|
||||
|
||||
@@ -19,8 +19,8 @@ return{
|
||||
bg="game2",bgm="push",
|
||||
},
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
newAIPlayer(2,965,360,.5,AITemplate("CC",10,2,true,12600))
|
||||
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)
|
||||
|
||||
@@ -19,8 +19,8 @@ return{
|
||||
bg="game2",bgm="push",
|
||||
},
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
newAIPlayer(2,965,360,.5,AITemplate("CC",10,3,true,16260))
|
||||
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)
|
||||
|
||||
@@ -19,8 +19,8 @@ return{
|
||||
bg="game2",bgm="push",
|
||||
},
|
||||
load=function()
|
||||
newPlayer(1,340,15)
|
||||
newAIPlayer(2,965,360,.5,AITemplate("CC",10,3,true,26000))
|
||||
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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -5,11 +5,11 @@ return{
|
||||
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=player.reach_winCheck,
|
||||
bg="strap",bgm="race",
|
||||
target=40,dropPiece=PLY.reach_winCheck,
|
||||
bg="aura",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
|
||||
@@ -25,7 +25,7 @@ return{
|
||||
end,
|
||||
score=function(P)return{P.stat.time,P.stat.piece}end,
|
||||
scoreDisp=function(D)return toTime(D[1]).." "..D[2].." Pieces"end,
|
||||
comp=function(a,b)return a[1]<b[1]or a[1]==b[1]and a[2]<b[2]end,
|
||||
comp=function(a,b)return a[2]>b[2]or a[2]==b[2]and a[1]<b[1]end,
|
||||
getRank=function(P)
|
||||
local T=P.stat.row
|
||||
if T<5 then
|
||||
|
||||
@@ -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<=360 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
|
||||
@@ -30,10 +30,10 @@ return{
|
||||
local T=P.stat.time
|
||||
return
|
||||
T<=626 and 5 or
|
||||
T<=1000 and 4 or
|
||||
T<=1400 and 3 or
|
||||
T<=2260 and 2 or
|
||||
T<=3260 and 1 or
|
||||
T<=888 and 4 or
|
||||
T<=1140 and 3 or
|
||||
T<=1406 and 2 or
|
||||
T<=1626 and 1 or
|
||||
0
|
||||
end,
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -32,8 +32,8 @@ return{
|
||||
T<=255 and 5 or
|
||||
T<=326 and 4 or
|
||||
T<=462 and 3 or
|
||||
T<=626 and 2 or
|
||||
T<=1260 and 1 or
|
||||
T<=555 and 2 or
|
||||
T<=626 and 1 or
|
||||
0
|
||||
end,
|
||||
}
|
||||
@@ -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)
|
||||
|
||||