This commit is contained in:
MrZ_26
2020-02-18 23:05:10 +08:00
parent 4da080c6f5
commit d02048f0dc
67 changed files with 865 additions and 546 deletions

Binary file not shown.

BIN
SFX/finesseError.ogg Normal file

Binary file not shown.

View File

@@ -1,10 +1,10 @@
gameVersion="Alpha V0.8.7" gameVersion="Alpha V0.8.8"
function love.conf(t) function love.conf(t)
t.identity="Techmino"--Save directory name t.identity="Techmino"--Save directory name
t.version="11.1" t.version="11.1"
t.console=X t.console=false
t.gammacorrect=X t.gammacorrect=false
t.appendidentity=X--Search files in source before save directory t.appendidentity=false--Search files in source before save directory
t.accelerometerjoystick=false--ios/android加速度计=摇杆 t.accelerometerjoystick=false--ios/android加速度计=摇杆
t.audio.mixwithsystem=true t.audio.mixwithsystem=true
@@ -13,23 +13,23 @@ function love.conf(t)
W.icon="/image/icon.png" W.icon="/image/icon.png"
W.width,W.height=1280,720 W.width,W.height=1280,720
W.minwidth,W.minheight=640,360 W.minwidth,W.minheight=640,360
W.borderless=X W.borderless=false
W.resizable=1 W.resizable=true
W.fullscreentype="desktop"--"exclusive" W.fullscreentype="desktop"--"exclusive"
W.fullscreen=X W.fullscreen=false
W.vsync=0--0:∞fps W.vsync=0--0:∞fps
W.msaa=X--The number of samples to use with multi-sampled antialiasing (number) W.msaa=false--The number of samples to use with multi-sampled antialiasing (number)
W.depth=0--Bits per sample in the depth buffer W.depth=0--Bits per sample in the depth buffer
W.stencil=1--Bits per sample in the stencil buffer W.stencil=1--Bits per sample in the stencil buffer
W.display=1--Monitor ID W.display=1--Monitor ID
W.highdpi=X--Enable high-dpi mode for the window on a Retina display (boolean) W.highdpi=false--Enable high-dpi mode for the window on a Retina display (boolean)
W.x,W.y=nil W.x,W.y=nil
local M=t.modules local M=t.modules
M.window,M.system,M.event=1,1,1 M.window,M.system,M.event=true,true,true
M.audio,M.sound=1,1 M.audio,M.sound=true,true
M.math,M.data=1,1 M.math,M.data=true,true
M.timer,M.graphics,M.font,M.image=1,1,1,1 M.timer,M.graphics,M.font,M.image=true,true,true,true
M.mouse,M.touch,M.keyboard,M.joystick=1,1,1,1 M.mouse,M.touch,M.keyboard,M.joystick=true,true,true,true
M.physics,M.thread,M.video=X M.physics,M.thread,M.video=false,false,false
end end

View File

@@ -36,6 +36,7 @@ local function gameOver()
local m=M.unlock[i] local m=M.unlock[i]
modeRanks[m]=modes[m].score and 0 or 6 modeRanks[m]=modes[m].score and 0 or 6
end end
saveUnlock()
end end
end end
local D=M.score(P) local D=M.score(P)
@@ -54,6 +55,7 @@ local function gameOver()
if p==0 then if p==0 then
P:showText(text.newRecord,0,-100,100,"beat",.5) P:showText(text.newRecord,0,-100,100,"beat",.5)
end end
D.date=os.date("%Y/%m/%d %H:%M")
ins(L,p+1,D) ins(L,p+1,D)
if L[11]then L[11]=nil end if L[11]then L[11]=nil end
saveRecord(M.saveFileName,L) saveRecord(M.saveFileName,L)
@@ -88,7 +90,7 @@ function Event.win(P,result)
die(P) die(P)
P.result="WIN" P.result="WIN"
if modeEnv.royaleMode then if modeEnv.royaleMode then
P.rank=1 P.modeData.event=1
P:changeAtk() P:changeAtk()
end end
if P.human then if P.human then
@@ -130,8 +132,8 @@ function Event.lose(P)
P.result="K.O." P.result="K.O."
if modeEnv.royaleMode then if modeEnv.royaleMode then
P:changeAtk() P:changeAtk()
P.rank=#players.alive+1 P.modeData.event=#players.alive+1
P:showText(P.rank,0,-120,60,"appear",1,12) P:showText(P.modeData.event,0,-120,60,"appear",1,12)
P.strength=0 P.strength=0
if P.lastRecv then if P.lastRecv then
local A,i=P,0 local A,i=P,0
@@ -142,7 +144,7 @@ function Event.lose(P)
if P.id==1 or A.id==1 then if P.id==1 or A.id==1 then
P.killMark=A.id==1 P.killMark=A.id==1
end end
A.ko,A.badge=A.ko+1,A.badge+P.badge+1 A.modeData.point,A.badge=A.modeData.point+1,A.badge+P.badge+1
for i=A.strength+1,4 do for i=A.strength+1,4 do
if A.badge>=royaleData.powerUp[i]then if A.badge>=royaleData.powerUp[i]then
A.strength=i A.strength=i
@@ -254,91 +256,91 @@ end
-------------------------</Tasks>------------------------- -------------------------</Tasks>-------------------------
-------------------------<Modes>-------------------------- -------------------------<Modes>--------------------------
modes={ modes={
{"sprint_10", id=1, x=0, y=0, shape=1,size=35,unlock={2,3}}, {"sprint_10", id=1, x=0, y=0, size=35,shape=1,icon="timer", unlock={2,3}},
{"sprint_20", id=2, x=-300, y=0, shape=1,size=45,unlock={73,74,75}}, {"sprint_20", id=2, x=-300, y=0, size=45,shape=1,icon="timer", unlock={73,74,75}},
{"sprint_40", id=3, x=0, y=-400, shape=1,size=55,unlock={4,9}}, {"sprint_40", id=3, x=0, y=-400, size=55,shape=1,icon="timer", unlock={4,9}},
{"sprint_100", id=4, x=-200, y=-400, shape=1,size=45,unlock={5,7}}, {"sprint_100", id=4, x=-200, y=-400, size=45,shape=1,icon="timer", unlock={5,7}},
{"sprint_400", id=5, x=-400, y=-400, shape=1,size=35,unlock={6}}, {"sprint_400", id=5, x=-400, y=-400, size=35,shape=1,icon="timer", unlock={6}},
{"sprint_1000", id=6, x=-600, y=-400, shape=1,size=35,unlock={}}, {"sprint_1000", id=6, x=-600, y=-400, size=35,shape=1,icon="timer", unlock={}},
{"drought_normal", id=7, x=-400, y=-200, shape=1,size=35,unlock={8}}, {"drought_normal", id=7, x=-400, y=-200, size=35,shape=1,icon="noI", unlock={8}},
{"drought_lunatic", id=8, x=-600, y=-200, shape=1,size=35,unlock={}}, {"drought_lunatic", id=8, x=-600, y=-200, size=35,shape=1,icon="mess", unlock={}},
{"marathon_normal", id=9, x=0, y=-600, shape=1,size=55,unlock={10,11,22,31,36,37,48,68,71,72}}, {"marathon_normal", id=9, x=0, y=-600, size=55,shape=1,icon="flag", unlock={10,11,22,31,36,37,48,68,71,72}},
{"marathon_hard", id=10, x=0, y=-800, shape=1,size=45,unlock={27}}, {"marathon_hard", id=10, x=0, y=-800, size=45,shape=1,icon="flag", unlock={27}},
{"solo_1", id=11, x=-300, y=-1000, shape=1,size=35,unlock={12}}, {"solo_1", id=11, x=-300, y=-1000, size=35,shape=1,icon="solo", unlock={12}},
{"solo_2", id=12, x=-500, y=-1000, shape=1,size=35,unlock={13}}, {"solo_2", id=12, x=-500, y=-1000, size=35,shape=1,icon="solo", unlock={13}},
{"solo_3", id=13, x=-700, y=-1000, shape=1,size=35,unlock={14,16}}, {"solo_3", id=13, x=-700, y=-1000, size=35,shape=1,icon="solo", unlock={14,16}},
{"solo_4", id=14, x=-900, y=-1000, shape=1,size=35,unlock={15}}, {"solo_4", id=14, x=-900, y=-1000, size=35,shape=1,icon="solo", unlock={15}},
{"solo_5", id=15, x=-1100, y=-1000, shape=1,size=35,unlock={}}, {"solo_5", id=15, x=-1100, y=-1000, size=35,shape=1,icon="solo", unlock={}},
{"techmino49_easy", id=16, x=-900, y=-1200, shape=1,size=35,unlock={17,19}}, {"techmino49_easy", id=16, x=-900, y=-1200, size=35,shape=1,icon="", unlock={17,19}},
{"techmino49_hard", id=17, x=-900, y=-1400, shape=1,size=35,unlock={18}}, {"techmino49_hard", id=17, x=-900, y=-1400, size=35,shape=1,icon="", unlock={18}},
{"techmino49_ultimate", id=18, x=-900, y=-1600, shape=1,size=35,unlock={}}, {"techmino49_ultimate", id=18, x=-900, y=-1600, size=35,shape=1,icon="", unlock={}},
{"techmino99_easy", id=19, x=-1100, y=-1400, shape=1,size=35,unlock={20}}, {"techmino99_easy", id=19, x=-1100, y=-1400, size=35,shape=1,icon="", unlock={20}},
{"techmino99_hard", id=20, x=-1100, y=-1600, shape=1,size=35,unlock={21}}, {"techmino99_hard", id=20, x=-1100, y=-1600, size=35,shape=1,icon="", unlock={21}},
{"techmino99_ultimate", id=21, x=-1100, y=-1800, shape=1,size=35,unlock={}}, {"techmino99_ultimate", id=21, x=-1100, y=-1800, size=35,shape=1,icon="", unlock={}},
{"round_1", id=22, x=-300, y=-800, shape=1,size=35,unlock={23}}, {"round_1", id=22, x=-300, y=-800, size=35,shape=1,icon="round", unlock={23}},
{"round_2", id=23, x=-500, y=-800, shape=1,size=35,unlock={24}}, {"round_2", id=23, x=-500, y=-800, size=35,shape=1,icon="round", unlock={24}},
{"round_3", id=24, x=-700, y=-800, shape=1,size=35,unlock={25}}, {"round_3", id=24, x=-700, y=-800, size=35,shape=1,icon="round", unlock={25}},
{"round_4", id=25, x=-900, y=-800, shape=1,size=35,unlock={26}}, {"round_4", id=25, x=-900, y=-800, size=35,shape=1,icon="round", unlock={26}},
{"round_5", id=26, x=-1100, y=-800, shape=1,size=35,unlock={}}, {"round_5", id=26, x=-1100, y=-800, size=35,shape=1,icon="round", unlock={}},
{"master_beginner", id=27, x=0, y=-1000, shape=1,size=35,unlock={28}}, {"master_beginner", id=27, x=0, y=-1000, size=35,shape=1,icon="", unlock={28}},
{"master_adavnce", id=28, x=0, y=-1200, shape=1,size=35,unlock={29,30}}, {"master_adavnce", id=28, x=0, y=-1200, size=35,shape=1,icon="", unlock={29,30}},
{"master_final", id=29, x=0, y=-1400, shape=1,size=35,unlock={}}, {"master_final", id=29, x=0, y=-1400, size=35,shape=1,icon="", unlock={}},
{"GM", id=30, x=150, y=-1500, shape=1,size=35,unlock={}}, {"GM", id=30, x=150, y=-1500, size=35,shape=1,icon="", unlock={}},
{"blind_easy", id=31, x=150, y=-700, shape=1,size=35,unlock={32}}, {"blind_easy", id=31, x=150, y=-700, size=35,shape=1,icon="", unlock={32}},
{"blind_normal", id=32, x=150, y=-800, shape=1,size=35,unlock={33}}, {"blind_normal", id=32, x=150, y=-800, size=35,shape=1,icon="", unlock={33}},
{"blind_hard", id=33, x=150, y=-900, shape=1,size=35,unlock={34}}, {"blind_hard", id=33, x=150, y=-900, size=35,shape=1,icon="", unlock={34}},
{"blind_lunatic", id=34, x=150, y=-1000, shape=1,size=35,unlock={35}}, {"blind_lunatic", id=34, x=150, y=-1000, size=35,shape=1,icon="", unlock={35}},
{"blind_ultimate", id=35, x=150, y=-1100, shape=1,size=35,unlock={}}, {"blind_ultimate", id=35, x=150, y=-1100, size=35,shape=1,icon="", unlock={}},
{"classic_fast", id=36, x=-300, y=-1200, shape=1,size=35,unlock={}}, {"classic_fast", id=36, x=-300, y=-1200, size=35,shape=2,icon="classic", unlock={}},
{"survivor_easy", id=37, x=300, y=-600, shape=1,size=35,unlock={38}}, {"survivor_easy", id=37, x=300, y=-600, size=35,shape=1,icon="", unlock={38}},
{"survivor_normal", id=38, x=500, y=-600, shape=1,size=35,unlock={39,42,44,46}}, {"survivor_normal", id=38, x=500, y=-600, size=35,shape=1,icon="", unlock={39,42,44,46}},
{"survivor_hard", id=39, x=700, y=-600, shape=1,size=35,unlock={40}}, {"survivor_hard", id=39, x=700, y=-600, size=35,shape=1,icon="", unlock={40}},
{"survivor_lunatic", id=40, x=900, y=-600, shape=1,size=35,unlock={41}}, {"survivor_lunatic", id=40, x=900, y=-600, size=35,shape=1,icon="", unlock={41}},
{"survivor_ultimate", id=41, x=1100, y=-600, shape=1,size=35,unlock={}}, {"survivor_ultimate", id=41, x=1100, y=-600, size=35,shape=1,icon="", unlock={}},
{"attacker_hard", id=42, x=300, y=-800, shape=1,size=35,unlock={43}}, {"attacker_hard", id=42, x=300, y=-800, size=35,shape=1,icon="", unlock={43}},
{"attacker_ultimate", id=43, x=300, y=-1000, shape=1,size=35,unlock={}}, {"attacker_ultimate", id=43, x=300, y=-1000, size=35,shape=1,icon="", unlock={}},
{"defender_normal", id=44, x=500, y=-800, shape=1,size=35,unlock={45}}, {"defender_normal", id=44, x=500, y=-800, size=35,shape=1,icon="", unlock={45}},
{"defender_lunatic", id=45, x=500, y=-1000, shape=1,size=35,unlock={}}, {"defender_lunatic", id=45, x=500, y=-1000, size=35,shape=1,icon="", unlock={}},
{"dig_hard", id=46, x=700, y=-800, shape=1,size=35,unlock={47}}, {"dig_hard", id=46, x=700, y=-800, size=35,shape=1,icon="", unlock={47}},
{"dig_ultimate", id=47, x=700, y=-1000, shape=1,size=35,unlock={}}, {"dig_ultimate", id=47, x=700, y=-1000, size=35,shape=1,icon="", unlock={}},
{"bigbang", id=48, x=400, y=-400, shape=1,size=55,unlock={49,51,56}}, {"bigbang", id=48, x=400, y=-400, size=55,shape=1,icon="", unlock={49,51,56}},
{"c4wtrain_normal", id=49, x=700, y=-400, shape=1,size=35,unlock={50}}, {"c4wtrain_normal", id=49, x=700, y=-400, size=35,shape=1,icon="", unlock={50}},
{"c4wtrain_lunatic", id=50, x=900, y=-400, shape=1,size=35,unlock={}}, {"c4wtrain_lunatic", id=50, x=900, y=-400, size=35,shape=1,icon="", unlock={}},
{"pctrain_normal", id=51, x=700, y=-200, shape=1,size=35,unlock={52,53}}, {"pctrain_normal", id=51, x=700, y=-200, size=35,shape=1,icon="", unlock={52,53}},
{"pctrain_lunatic", id=52, x=900, y=-200, shape=1,size=35,unlock={}}, {"pctrain_lunatic", id=52, x=900, y=-200, size=35,shape=1,icon="", unlock={}},
{"pcchallenge_normal", id=53, x=800, y=-100, shape=1,size=35,unlock={54}}, {"pcchallenge_normal", id=53, x=800, y=-100, size=35,shape=1,icon="", unlock={54}},
{"pcchallenge_hard", id=54, x=1000, y=-100, shape=1,size=35,unlock={55}}, {"pcchallenge_hard", id=54, x=1000, y=-100, size=35,shape=1,icon="", unlock={55}},
{"pcchallenge_lunatic", id=55, x=1200, y=-100, shape=1,size=35,unlock={}}, {"pcchallenge_lunatic", id=55, x=1200, y=-100, size=35,shape=1,icon="", unlock={}},
{"tech_normal", id=56, x=400, y=-100, shape=1,size=35,unlock={57,58}}, {"tech_normal", id=56, x=400, y=-100, size=35,shape=1,icon="", unlock={57,58}},
{"tech_normal+", id=57, x=650, y=150, shape=1,size=35,unlock={64,67}}, {"tech_normal+", id=57, x=650, y=150, size=35,shape=1,icon="", unlock={64,67}},
{"tech_hard", id=58, x=400, y=50, shape=1,size=35,unlock={59,60}}, {"tech_hard", id=58, x=400, y=50, size=35,shape=1,icon="", unlock={59,60}},
{"tech_hard+", id=59, x=250, y=50, shape=1,size=35,unlock={}}, {"tech_hard+", id=59, x=250, y=50, size=35,shape=1,icon="", unlock={}},
{"tech_lunatic", id=60, x=400, y=200, shape=1,size=35,unlock={61,62}}, {"tech_lunatic", id=60, x=400, y=200, size=35,shape=1,icon="", unlock={61,62}},
{"tech_lunatic+", id=61, x=250, y=200, shape=1,size=35,unlock={}}, {"tech_lunatic+", id=61, x=250, y=200, size=35,shape=1,icon="", unlock={}},
{"tech_ultimate", id=62, x=400, y=350, shape=1,size=35,unlock={63}}, {"tech_ultimate", id=62, x=400, y=350, size=35,shape=1,icon="", unlock={63}},
{"tech_ultimate+", id=63, x=250, y=350, shape=1,size=35,unlock={}}, {"tech_ultimate+", id=63, x=250, y=350, size=35,shape=1,icon="", unlock={}},
{"tsd_easy", id=64, x=800, y=200, shape=1,size=35,unlock={65}}, {"tsd_easy", id=64, x=800, y=200, size=35,shape=1,icon="", unlock={65}},
{"tsd_hard", id=65, x=1000, y=200, shape=1,size=35,unlock={66}}, {"tsd_hard", id=65, x=1000, y=200, size=35,shape=1,icon="", unlock={66}},
{"tsd_ultimate", id=66, x=1200, y=200, shape=1,size=35,unlock={}}, {"tsd_ultimate", id=66, x=1200, y=200, size=35,shape=1,icon="", unlock={}},
{"ultra", id=67, x=650, y=400, shape=1,size=35,unlock={}}, {"ultra", id=67, x=650, y=400, size=35,shape=1,icon="", unlock={}},
{"zen", id=68, x=-900, y=-600, shape=1,size=35,unlock={69,70}}, {"zen", id=68, x=-900, y=-600, size=35,shape=1,icon="zen", unlock={69,70}},
{"infinite", id=69, x=-900, y=-400, shape=1,size=35,unlock={}}, {"infinite", id=69, x=-900, y=-400, size=35,shape=1,icon="", unlock={}},
{"infinite_dig", id=70, x=-1100, y=-600, shape=1,size=35,unlock={}}, {"infinite_dig", id=70, x=-1100, y=-600, size=35,shape=1,icon="", unlock={}},
{"custom_clear", id=71, x=200, y=-350, shape=2,size=45,unlock={}}, {"custom_clear", id=71, x=200, y=-350, size=45,shape=3,icon="custom", unlock={}},
{"custom_puzzle", id=72, x=200, y=-200, shape=2,size=45,unlock={}}, {"custom_puzzle", id=72, x=200, y=-200, size=45,shape=3,icon="puzzle", unlock={}},
{"hotseat_2P", id=73, x=-300, y=200, shape=2,size=45,unlock={}}, {"hotseat_2P", id=73, x=-300, y=200, size=45,shape=3,icon="", unlock={}},
{"hotseat_3P", id=74, x=-450, y=200, shape=2,size=45,unlock={}}, {"hotseat_3P", id=74, x=-450, y=200, size=45,shape=3,icon="", unlock={}},
{"hotseat_4P", id=75, x=-600, y=200, shape=2,size=45,unlock={}}, {"hotseat_4P", id=75, x=-600, y=200, size=45,shape=3,icon="", unlock={}},
} }
modeRanks={} modeRanks={}
for i=1,#modes do for i=1,#modes do

View File

@@ -1,7 +1,10 @@
setting={ setting={
das=10,arr=2, das=10,arr=2,
sddas=0,sdarr=2, sddas=0,sdarr=2,
quickR=true,swap=true, reTime=10,
maxNext=6,
quickR=true,
swap=true,
fine=false, fine=false,
--game --game
@@ -14,13 +17,13 @@ setting={
fullscreen=false, fullscreen=false,
bg=true, bg=true,
bgblock=true, bgspace=true,
lang=1, lang=1,
skin=1, skin=1,
--graphic --graphic
sfx=10,bgm=7, sfx=10,bgm=7,
vib=3,voc=0, vib=0,voc=0,
stereo=6, stereo=6,
--sound --sound
@@ -32,12 +35,12 @@ setting={
{},{},{},{},{},{},{}, {},{},{},{},{},{},{},
--joystick --joystick
}, },
VKSwitch=true, VKSwitch=false,--if disp
VKTrack=true,--If tracked VKTrack=false,--if tracked
VKDodge=false,--If repel VKDodge=false,--if dodge
VKTchW=3,--Touch Weight VKTchW=3,--Touch-Pos Weight
VKCurW=4,--CurPos Weight VKCurW=4,--Cur-Pos Weight
VKIcon=true, VKIcon=true,--if disp icon
VKAlpha=3, VKAlpha=3,
--control --control
} }

BIN
font.ttf

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

BIN
image/BG/bg1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
image/mess/speedLimit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
image/modeIcon/custom.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 767 B

BIN
image/modeIcon/puzzle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1023 B

BIN
image/modeIcon/solo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 915 B

BIN
image/modeIcon/timer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
image/modeIcon/zen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -39,7 +39,7 @@ return{
custom="自定义游戏", custom="自定义游戏",
customOption={ customOption={
drop="下落延迟:", drop="下落速度:",
lock="锁定延迟:", lock="锁定延迟:",
wait="放块延迟:", wait="放块延迟:",
fall="消行延迟:", fall="消行延迟:",
@@ -68,7 +68,7 @@ return{
}, },
softdropdas="软降DAS:", softdropdas="软降DAS:",
softdroparr="软降ARR:", softdroparr="软降ARR:",
snapLevelName={"任意摆放","10px吸附","20px吸附","40px吸附","60px吸附","80px吸附"}, snapLevelName={"无吸附","10px吸附","20px吸附","40px吸附","60px吸附","80px吸附"},
keyboard="键盘",joystick="手柄", keyboard="键盘",joystick="手柄",
space="空格",enter="回车", space="空格",enter="回车",
ctrlSetHelp="方向键选择/翻页,回车修改,esc返回", ctrlSetHelp="方向键选择/翻页,回车修改,esc返回",
@@ -81,6 +81,7 @@ return{
settingSaved="设置已保存", settingSaved="设置已保存",
settingSavingError="设置保存失败:", settingSavingError="设置保存失败:",
statSavingError="数据保存失败:", statSavingError="数据保存失败:",
unlockSavingError="解锁保存失败",
copySuccess="已复制到剪切板", copySuccess="已复制到剪切板",
dataCorrupted="数据损坏", dataCorrupted="数据损坏",
VKTchW="触摸点权重", VKTchW="触摸点权重",
@@ -89,6 +90,7 @@ return{
noScore="暂无成绩", noScore="暂无成绩",
highScore="最佳成绩", highScore="最佳成绩",
newRecord="打破纪录", newRecord="打破纪录",
errorMsg="Techmino遇到了问题,需要重新启动.\n我们已收集了一些错误信息,你可以向作者进行反馈.",
actName=actName, actName=actName,
@@ -245,6 +247,8 @@ return{
arrD="-",arrU="+", arrD="-",arrU="+",
sddasD="-",sddasU="+", sddasD="-",sddasU="+",
sdarrD="-",sdarrU="+", sdarrD="-",sdarrU="+",
reTime="开局等待时间",
maxNext="最大预览数量",
quickR="快速重新开始", quickR="快速重新开始",
swap="组合键切换攻击模式", swap="组合键切换攻击模式",
fine="极简操作提示音", fine="极简操作提示音",
@@ -260,7 +264,7 @@ return{
center="旋转中心", center="旋转中心",
skin="皮肤", skin="皮肤",
bg="背景", bg="背景",
bgblock="背景动画", bgspace="星空背景",
smo="平滑下落", smo="平滑下落",
dropFX="下落特效等级", dropFX="下落特效等级",
shakeFX="晃动特效等级", shakeFX="晃动特效等级",

View File

@@ -68,7 +68,7 @@ return{
}, },
softdropdas="软降DAS:", softdropdas="软降DAS:",
softdroparr="软降ARR:", softdroparr="软降ARR:",
snapLevelName={"任意摆放","10px吸附","20px吸附","40px吸附","60px吸附","80px吸附"}, snapLevelName={"无吸附","10px吸附","20px吸附","40px吸附","60px吸附","80px吸附"},
keyboard="键盘",joystick="手柄", keyboard="键盘",joystick="手柄",
space="空格",enter="回车", space="空格",enter="回车",
ctrlSetHelp="方向键选择/翻页,回车修改,esc返回", ctrlSetHelp="方向键选择/翻页,回车修改,esc返回",
@@ -81,6 +81,7 @@ return{
settingSaved="设置已保存", settingSaved="设置已保存",
settingSavingError="设置保存失败:", settingSavingError="设置保存失败:",
statSavingError="数据保存失败:", statSavingError="数据保存失败:",
unlockSavingError="解锁保存失败",
copySuccess="已复制到剪切板", copySuccess="已复制到剪切板",
dataCorrupted="数据损坏", dataCorrupted="数据损坏",
VKTchW="触摸点权重", VKTchW="触摸点权重",
@@ -89,6 +90,7 @@ return{
noScore="暂无成绩", noScore="暂无成绩",
highScore="最佳成绩", highScore="最佳成绩",
newRecord="打破纪录", newRecord="打破纪录",
errorMsg="Techmino遇到了问题,需要重新启动.\n我们已收集了一些错误信息,你可以向作者进行反馈.",
actName=actName, actName=actName,
@@ -246,6 +248,8 @@ return{
arrD="-",arrU="+", arrD="-",arrU="+",
sddasD="-",sddasU="+", sddasD="-",sddasU="+",
sdarrD="-",sdarrU="+", sdarrD="-",sdarrU="+",
reTime="开局等待时间",
maxNext="最大预览数量",
quickR="快速重新开始", quickR="快速重新开始",
swap="组合键切换攻击模式", swap="组合键切换攻击模式",
fine="极简操作提示音", fine="极简操作提示音",
@@ -261,7 +265,7 @@ return{
center="旋转中心", center="旋转中心",
skin="皮肤", skin="皮肤",
bg="背景", bg="背景",
bgblock="背景动画", bgspace="星空背景",
smo="平滑下落", smo="平滑下落",
dropFX="下落特效等级", dropFX="下落特效等级",
shakeFX="晃动特效等级", shakeFX="晃动特效等级",

View File

@@ -37,7 +37,7 @@ return{
custom="Custom Game", custom="Custom Game",
customOption={ customOption={
drop="Drop delay:", drop="Drop speed:",
lock="Lock delay:", lock="Lock delay:",
wait="Next piece delay:", wait="Next piece delay:",
fall="Clear row delay:", fall="Clear row delay:",
@@ -79,6 +79,7 @@ return{
settingSaved="Setting saved", settingSaved="Setting saved",
settingSavingError="Failed to save setting:", settingSavingError="Failed to save setting:",
statSavingError="Failed to save stat:", statSavingError="Failed to save stat:",
unlockSavingError="Failed to save unlock:",
copySuccess="Copy Success", copySuccess="Copy Success",
dataCorrupted="Data Corrupted", dataCorrupted="Data Corrupted",
VKTchW="Touch weight", VKTchW="Touch weight",
@@ -87,6 +88,7 @@ return{
noScore="No Score Yet", noScore="No Score Yet",
highScore="Highscore", highScore="Highscore",
newRecord="New Rocord", newRecord="New Rocord",
errorMsg="Techmino ran into a problem and needs to restart.\nWe collected some error info,and you can send them to author.",
actName=actName, actName=actName,
@@ -244,6 +246,8 @@ Lib used:
arrD="-",arrU="+", arrD="-",arrU="+",
sddasD="-",sddasU="+", sddasD="-",sddasU="+",
sdarrD="-",sdarrU="+", sdarrD="-",sdarrU="+",
reTime="Delay before game",
maxNext="Max next count",
quickR="Quick restart", quickR="Quick restart",
swap="Combo key to change ATK mode", swap="Combo key to change ATK mode",
fine="Finesse error SFX", fine="Finesse error SFX",
@@ -259,7 +263,7 @@ Lib used:
center="Center", center="Center",
skin="Skin", skin="Skin",
bg="Background", bg="Background",
bgblock="BG animation", bgspace="BG space",
smo="Smoooth drop", smo="Smoooth drop",
dropFX="Drop FX level", dropFX="Drop FX level",
shakeFX="Shake FX level", shakeFX="Shake FX level",

View File

@@ -59,7 +59,7 @@ blockColor={
sfx={ sfx={
"welcome", "welcome",
"click","enter", "click","enter",
"error","error_long", "finesseError","finesseError_long",
--Stereo sfxs(cannot set position) --Stereo sfxs(cannot set position)
"button","swipe", "button","swipe",
"ready","start","win","fail","collect", "ready","start","win","fail","collect",
@@ -72,6 +72,8 @@ sfx={
"spin_0","spin_1","spin_2","spin_3", "spin_0","spin_1","spin_2","spin_3",
"emit","blip_1","blip_2", "emit","blip_1","blip_2",
"perfectclear", "perfectclear",
"error",
--Mono sfxs --Mono sfxs
} }
bgm={ bgm={

326
main.lua
View File

@@ -2,11 +2,13 @@
第一次搞这么大的工程,参考价值不是很大 第一次搞这么大的工程,参考价值不是很大
如果你有时间并且也热爱俄罗斯方块的话,来看代码或者帮助优化的话欢迎! 如果你有时间并且也热爱俄罗斯方块的话,来看代码或者帮助优化的话欢迎!
]] ]]
math.randomseed(os.time()*626)
local love=love local love=love
local ms,kb,tc=love.mouse,love.keyboard,love.touch local ms,kb,tc=love.mouse,love.keyboard,love.touch
local gc,sys=love.graphics,love.system local gc,sys=love.graphics,love.system
local Timer=love.timer.getTime local Timer=love.timer.getTime
local int,rnd,max,min=math.floor,math.random,math.max,math.min local int,rnd,max,min=math.floor,math.random,math.max,math.min
local abs=math.abs
local rem=table.remove local rem=table.remove
package.path="?.lua"--boost package.path="?.lua"--boost
@@ -18,10 +20,11 @@ local xOy=love.math.newTransform()
local mx,my,mouseShow=-20,-20,false local mx,my,mouseShow=-20,-20,false
local touching=nil--第一触摸ID local touching=nil--第一触摸ID
local touchDist=nil local touchDist=nil
joysticks={}
local devMode=0 local devMode=0
players={alive={},human=0} players={alive={},human=0}
scr={x=0,y=0,w=nil,h=nil,k=1} scr={x=0,y=0,w=0,h=0,rad=0,k=1}--x,y,wid,hei,radius,scale K
local scr=scr local scr=scr
mapCam={ mapCam={
sel=nil,--selected mode ID sel=nil,--selected mode ID
@@ -58,6 +61,7 @@ for i=11,20 do preField[i]={0,0,0,0,0,0,0,0,0,0}end
freeRow={L=40}for i=1,40 do freeRow[i]={0,0,0,0,0,0,0,0,0,0}end freeRow={L=40}for i=1,40 do freeRow[i]={0,0,0,0,0,0,0,0,0,0}end
--Game system Vars --Game system Vars
------------------------------------------------------------- -------------------------------------------------------------
space=require("parts/space")local space=space
setFont=require("parts/font") setFont=require("parts/font")
blocks=require("parts/mino") blocks=require("parts/mino")
-- require("parts/light") -- require("parts/light")
@@ -118,19 +122,6 @@ if sys.getPowerInfo()~="unknown"then
end end
end end
end end
local function getNewBlock()
FX_BGblock.ct=FX_BGblock.ct+1
if FX_BGblock.ct==17 then FX_BGblock.ct=1 end
local t=FX_BGblock.list[FX_BGblock.ct]
t.bn,t.size=FX_BGblock.next,2+3*rnd()
t.b=blocks[t.bn][rnd(0,3)]
t.x=rnd(-#t.b[1]*t.size*30+100,1180)
t.y=0
t.ty=720+#t.b*30*t.size
t.v=t.size*(1+rnd())
FX_BGblock.next=FX_BGblock.next%7+1
return t
end
local function onVirtualkey(x,y) local function onVirtualkey(x,y)
local dist,nearest=1e10 local dist,nearest=1e10
for K=1,#virtualkey do for K=1,#virtualkey do
@@ -221,6 +212,8 @@ local function onMode(x,y)
if M.shape==1 then 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 _ end
elseif M.shape==2 then elseif M.shape==2 then
if abs(x-M.x)+abs(y-M.y)<s then return _ 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 _ end
end end
end end
@@ -438,10 +431,10 @@ function keyDown.draw(key)
end end
elseif key=="escape"then elseif key=="escape"then
scene.back() scene.back()
elseif key=="c"then elseif key=="c"and kb.isDown("lctrl","rctrl")then
if kb.isDown("lctrl","rctrl")then copyBoard()end copyBoard()
elseif key=="v"then elseif key=="v"and kb.isDown("lctrl","rctrl")then
if kb.isDown("lctrl","rctrl")then pasteBoard()end pasteBoard()
else else
pen=penKey[key]or pen pen=penKey[key]or pen
end end
@@ -455,6 +448,17 @@ function mouseDown.setting_sound(x,y,k)
if t>1 then if t>1 then
VOICE((t<1.5 or t>15)and"doubt"or rnd()<.8 and"happy"or"egg") VOICE((t<1.5 or t>15)and"doubt"or rnd()<.8 and"happy"or"egg")
sceneTemp.last=Timer() sceneTemp.last=Timer()
if rnd()<.26 then
for i=1,#modes do
local M=modes[i]
for i=1,#M.unlock do
local m=M.unlock[i]
modeRanks[m]=modes[m].score and(modeRanks[m]and max(modeRanks[m],0)or 0)or 6
end
end
saveUnlock()
TEXT("DEVMODE:UNLOCKALL",640,360,50,"stretch",.6)
end
end end
end end
end end
@@ -467,7 +471,7 @@ function keyDown.setting_key(key)
if key=="escape"then if key=="escape"then
if s.kS then if s.kS then
s.kS=false s.kS=false
SFX("error",.5) SFX("finesseError",.5)
else else
scene.back() scene.back()
end end
@@ -514,7 +518,7 @@ function gamepadDown.setting_key(key)
if key=="back"then if key=="back"then
if s.jS then if s.jS then
s.jS=false s.jS=false
SFX("error",.5) SFX("finesseError",.5)
else else
scene.back() scene.back()
end end
@@ -797,10 +801,11 @@ local function widgetControl_gamepad(i)
end end
local lastX,lastY--last clickDown pos local lastX,lastY--last clickDown pos
function love.mousepressed(x,y,k,t,num) function love.mousepressed(x,y,k,t,num)
if t then return end
mouseShow=true mouseShow=true
mx,my=xOy:inverseTransformPoint(x,y) mx,my=xOy:inverseTransformPoint(x,y)
if devMode>0 then print(mx,my)end if devMode>0 then print(mx,my)end
if t or scene.swapping then return end if scene.swapping then return end
if mouseDown[scene.cur]then if mouseDown[scene.cur]then
mouseDown[scene.cur](mx,my,k) mouseDown[scene.cur](mx,my,k)
elseif k==2 then elseif k==2 then
@@ -815,9 +820,10 @@ function love.mousepressed(x,y,k,t,num)
lastY=my lastY=my
end end
function love.mousemoved(x,y,dx,dy,t) function love.mousemoved(x,y,dx,dy,t)
if t then return end
mouseShow=true mouseShow=true
mx,my=xOy:inverseTransformPoint(x,y) mx,my=xOy:inverseTransformPoint(x,y)
if t or scene.swapping then return end if scene.swapping then return end
dx,dy=dx/scr.k,dy/scr.k dx,dy=dx/scr.k,dy/scr.k
if mouseMove[scene.cur]then if mouseMove[scene.cur]then
mouseMove[scene.cur](mx,my,dx,dy) mouseMove[scene.cur](mx,my,dx,dy)
@@ -835,6 +841,7 @@ function love.mousemoved(x,y,dx,dy,t)
end end
end end
function love.mousereleased(x,y,k,t,num) function love.mousereleased(x,y,k,t,num)
if t then return end
mx,my=xOy:inverseTransformPoint(x,y) mx,my=xOy:inverseTransformPoint(x,y)
if t or scene.swapping then return end if t or scene.swapping then return end
if mouseUp[scene.cur]then if mouseUp[scene.cur]then
@@ -917,6 +924,8 @@ function love.keypressed(i)
elseif i=="q"then elseif i=="q"then
local W=widget_sel local W=widget_sel
if W then W:getInfo()end if W then W:getInfo()end
elseif i=="e"then
error("Error Test")
elseif widget_sel then elseif widget_sel then
local W=widget_sel local W=widget_sel
if i=="left"then W.x=W.x-10 if i=="left"then W.x=W.x-10
@@ -943,6 +952,17 @@ function love.keyreleased(i)
if keyUp[scene.cur]then keyUp[scene.cur](i)end if keyUp[scene.cur]then keyUp[scene.cur](i)end
end end
function love.joystickadded(JS)
joysticks[#joysticks+1]=JS
end
function love.joystickremoved(JS)
for i=1,#joysticks do
if joysticks[i]==JS then
rem(joysticks,i)
return
end
end
end
local keyMirror={ local keyMirror={
dpup="up", dpup="up",
dpdown="down", dpdown="down",
@@ -966,9 +986,26 @@ function love.gamepadreleased(joystick,i)
end end
end end
--[[ --[[
function love.joystickpressed(js,k)end function love.joystickpressed(JS,k)
function love.joystickaxis(js,axis,val)end mouseShow=false
function love.joystickhat(js,hat,dir)end if scene.swapping then return end
if gamepadDown[scene.cur]then gamepadDown[scene.cur](i)
elseif keyDown[scene.cur]then keyDown[scene.cur](keyMirror[i]or i)
elseif i=="back"then scene.back()
else widgetControl_gamepad(i)
end
end
function love.joystickreleased(JS,k)
if scene.swapping then return end
if gamepadUp[scene.cur]then gamepadUp[scene.cur](i)
end
end
function love.joystickaxis(JS,axis,val)
end
function love.joystickhat(JS,hat,dir)
end
function love.sendData(data)end function love.sendData(data)end
function love.receiveData(id,data)end function love.receiveData(id,data)end
]] ]]
@@ -978,6 +1015,7 @@ end
function love.resize(w,h) function love.resize(w,h)
love.timer.sleep(.26) love.timer.sleep(.26)
scr.w,scr.h,scr.r=w,h,h/w scr.w,scr.h,scr.r=w,h,h/w
scr.rad=(w^2+h^2)^.5
if scr.r>=.5625 then if scr.r>=.5625 then
scr.k=w/1280 scr.k=w/1280
scr.x,scr.y=0,(h-w*9/16)*.5 scr.x,scr.y=0,(h-w*9/16)*.5
@@ -985,14 +1023,19 @@ function love.resize(w,h)
scr.k=h/720 scr.k=h/720
scr.x,scr.y=(w-h*16/9)*.5,0 scr.x,scr.y=(w-h*16/9)*.5,0
end end
gc.origin()
xOy=xOy:setTransformation(w*.5,h*.5,nil,scr.k,nil,640,360) xOy=xOy:setTransformation(w*.5,h*.5,nil,scr.k,nil,640,360)
gc.replaceTransform(xOy) if setting.bgspace then
space.resize(w,h)
space.new()
end
end end
function love.focus(f) function love.focus(f)
if system~="Android" and not f and scene.cur=="play"then pauseGame()end if system~="Android" and not f and scene.cur=="play"then pauseGame()end
end end
function love.update(dt) function love.update(dt)
if setting.bgspace then
space.update()
end
for i=#sysFX,1,-1 do for i=#sysFX,1,-1 do
local S=sysFX[i] local S=sysFX[i]
S[2]=S[2]+1 S[2]=S[2]+1
@@ -1002,18 +1045,6 @@ function love.update(dt)
end end
end end
end end
for i=#FX_BGblock,1,-1 do
local B=FX_BGblock[i]
B.y=B.y+B.v
if B.y>B.ty then rem(FX_BGblock,i)end
end
if setting.bgblock then
FX_BGblock.tm=FX_BGblock.tm-1
if FX_BGblock.tm==0 then
FX_BGblock[#FX_BGblock+1]=getNewBlock()
FX_BGblock.tm=rnd(20,30)
end
end
for i=#texts,1,-1 do for i=#texts,1,-1 do
local t=texts[i] local t=texts[i]
t.c=t.c+t.spd t.c=t.c+t.spd
@@ -1092,103 +1123,162 @@ function love.update(dt)
W:update() W:update()
end--更新控件 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)
-- err=err:gsub("%[string \"(.-)\"%]","%1")
local CAP
local function _(_)CAP=gc.newImage(_)end
gc.captureScreenshot(_)
local T=0
return function()
PUMP()
for e,a,b in POLL()do
if e=="quit"or a=="escape"then
destroyPlayers()
return 1
elseif a=="return"or a=="start"then
destroyPlayers()
return"restart"
elseif e=="resize"then
T=2
love.resize(a,b)
end
end
T=T+1
if T==1 then
if sfx.error then
SFX("error",.8)
end
elseif T==2 then
gc.clear(.3,.5,.9)
elseif T==3 then
gc.setColor(1,1,1)
gc.push("transform")
gc.replaceTransform(xOy)
gc.draw(CAP,100,365,nil,512/CAP:getWidth(),288/CAP:getHeight())
gc.pop()
elseif T==4 then
gc.push("transform")
gc.replaceTransform(xOy)
setFont(120)
gc.print(":(",100,40)
setFont(38)
gc.printf(text.errorMsg,100,200,1280-100)
setFont(20)
gc.print(err[1],626,360)
gc.print("TRACEBACK",626,410)
for i=4,#err-2 do
gc.print(err[i],626,355+20*i)
end
gc.pop()
end
gc.present()
love.timer.sleep(.1)
end
end
local scs={1,2,1,2,1,2,1,2,1,2,1.5,1.5,.5,2.5} local scs={1,2,1,2,1,2,1,2,1,2,1.5,1.5,.5,2.5}
local FPS=love.timer.getFPS local FPS=love.timer.getFPS
function love.draw() function love.draw()
gc.discard()--SPEED UPUPUP! gc.discard()--SPEED UPUPUP!
Pnt.BG[setting.bg and curBG or"grey"]() Pnt.BG[setting.bg and curBG or"grey"]()
gc.setColor(1,1,1,.2) if setting.bgspace then
for n=1,#FX_BGblock do space.draw()
local b,img=FX_BGblock[n].b,blockSkin[FX_BGblock[n].bn] end
local size=FX_BGblock[n].size gc.push("transform")
for i=1,#b do for j=1,#b[1]do gc.replaceTransform(xOy)
if b[i][j]then if Pnt[scene.cur]then Pnt[scene.cur]()end
gc.draw(img,FX_BGblock[n].x+(j-1)*30*size,FX_BGblock[n].y-i*30*size,nil,size) for k,W in next,Widget[scene.cur]do
if not(W.hide and W.hide())then
W:draw()
end end
end end end--Draw widgets
end--Draw BG falling blocks if mouseShow then
if Pnt[scene.cur]then Pnt[scene.cur]()end local r=Timer()*.5
for k,W in next,Widget[scene.cur]do gc.setColor(1,1,1,min(1-math.abs(1-r%1*2),.3))
if not(W.hide and W.hide())then r=int(r)%7+1
W:draw() gc.draw(miniBlock[r],mx,my,Timer()%3.1416*4,20,20,scs[2*r]-.5,#blocks[r][0]-scs[2*r-1]+.5)
end gc.setColor(1,1,1,.5)gc.circle("fill",mx,my,5)
end--Draw widgets gc.setColor(1,1,1)gc.circle("fill",mx,my,3)
if mouseShow then end--Awesome mouse!
local r=Timer()*.5 gc.setLineWidth(6)
gc.setColor(1,1,1,min(1-math.abs(1-r%1*2),.3)) for i=1,#sysFX do
r=int(r)%7+1 local S=sysFX[i]
gc.draw(miniBlock[r],mx,my,Timer()%3.1416*4,20,20,scs[2*r]-.5,#blocks[r][0]-scs[2*r-1]+.5) if S[1]==0 then
gc.setColor(1,1,1,.5)gc.circle("fill",mx,my,5) gc.setColor(1,1,1,1-S[2]/S[3])
gc.setColor(1,1,1)gc.circle("fill",mx,my,3) local r=(10*S[2]/S[3])^1.2
end--Awesome mouse! gc.rectangle("line",S[4]-r,S[5]-r,S[6]+2*r,S[7]+2*r)
--按钮波纹
elseif S[1]==1 then
gc.setColor(S[4],S[5],S[6],1-S[2]/S[3])
gc.rectangle("fill",S[7],S[8],S[9],S[10],2)
--开关/滑条残影
end
end--guiFXs
for i=1,#texts do
local t=texts[i]
local p=t.c
gc.setColor(1,1,1,p<.2 and p*5 or p<.8 and 1 or 5-p*5)
setFont(t.font)
t:draw()
end--Floating Texts
gc.pop()
gc.setColor(1,1,1) gc.setColor(1,1,1)
if powerInfoCanvas then if powerInfoCanvas then
gc.draw(powerInfoCanvas) gc.draw(powerInfoCanvas)
end--Power Info end--Power Info
gc.setLineWidth(6)
for i=1,#sysFX do
local S=sysFX[i]
if S[1]==0 then
gc.setColor(1,1,1,1-S[2]/S[3])
local r=(10*S[2]/S[3])^1.2
gc.rectangle("line",S[4]-r,S[5]-r,S[6]+2*r,S[7]+2*r)
--按钮波纹
elseif S[1]==1 then
gc.setColor(S[4],S[5],S[6],1-S[2]/S[3])
gc.rectangle("fill",S[7],S[8],S[9],S[10],2)
--开关/滑条残影
end
end--guiFXs
for i=1,#texts do
local t=texts[i]
local p=t.c
gc.setColor(1,1,1,p<.2 and p*5 or p<.8 and 1 or 5-p*5)
setFont(t.font)
t:draw()
end--Floating Texts
if scene.swapping then if scene.swapping then
scene.swap.draw(scene.swap.time) local _=scene.swap
end--Swapping animation _.draw(_.time)
if scr.r~=.5625 then end--Scene swapping animation
gc.setColor(0,0,0)
if scr.r>.5625 then
local d=(scr.h-scr.w*9/16)*.5/scr.k
gc.rectangle("fill",0,0,1280,-d)
gc.rectangle("fill",0,720,1280,d)
else--高窗口
local d=(scr.w-scr.h*16/9)*.5/scr.k
gc.rectangle("fill",0,0,-d,720)
gc.rectangle("fill",1280,0,d,720)
end--扁窗口
end--Black side
setFont(15) setFont(15)
gc.setColor(1,1,1) gc.setColor(1,1,1)
gc.print(FPS(),5,700) local _=scr.h-20
gc.print(FPS(),5,_)
if devMode>0 then if devMode>0 then
gc.setColor(1,devMode==2 and .5 or 1,1) gc.setColor(1,1,devMode==2 and .6 or 1)
gc.print("Tasks:"..#Task,5,600) gc.print("Cache used:"..gcinfo(),5,_-20)
gc.print("Voices:"..#voiceQueue,5,620) gc.print("Free Row:"..#freeRow.."/"..freeRow.L,5,_-40)
gc.print("Mouse:"..mx.." "..my,5,640) gc.print("Mouse:"..mx.." "..my,5,_-60)
gc.print("Free Row:"..#freeRow.."/"..freeRow.L,5,660) gc.print("Voices:"..#voiceQueue,5,_-80)
gc.print("Cache used:"..gcinfo(),5,680) gc.print("Tasks:"..#Task,5,_-100)
end end--DEV info
end end
function love.run() function love.run()
local T=love.timer local T=love.timer
local lastFrame,lastFreshPow=T.getTime(),T.getTime() local sleep=T.sleep
local lastFrame,lastFreshPow=T.getTime()
local lastFreshPow=lastFrame
local readyDrawFrame=0 local readyDrawFrame=0
local mini=love.window.isMinimized local mini=love.window.isMinimized
local PUMP,POLL=love.event.pump,love.event.poll local PUMP,POLL=love.event.pump,love.event.poll
love.resize(gc.getWidth(),gc.getHeight()) love.resize(gc.getWidth(),gc.getHeight())
scene.init("load")--Scene Launch scene.init("load")--Scene Launch
while true do return function()
PUMP() PUMP()
for N,a,b,c,d,e in POLL()do for N,a,b,c,d,e in POLL()do
if N=="quit"then if love[N]then
destroyPlayers()
goto END
elseif love[N]then
love[N](a,b,c,d,e) love[N](a,b,c,d,e)
elseif N=="quit"then
destroyPlayers()
return 1
end end
end end
T.step() T.step()
@@ -1202,18 +1292,17 @@ function love.run()
end end
end end
if Timer()-lastFrame<.058 then if Timer()-lastFrame<.058 then
T.sleep(.01) sleep(.01)
end end
while Timer()-lastFrame<.0158 do while Timer()-lastFrame<.0158 do
T.sleep(.001) sleep(.001)
end end--try easily control 60FPS
lastFrame=Timer() lastFrame=Timer()
if Timer()-lastFreshPow>1 then if Timer()-lastFreshPow>1 then
updatePowerInfo() updatePowerInfo()
lastFreshPow=Timer() lastFreshPow=Timer()
end end
end end
::END::
end end
------------------------------------------------------------- -------------------------------------------------------------
local F=love.filesystem local F=love.filesystem
@@ -1237,15 +1326,16 @@ end
FILE={ FILE={
data=F.newFile("data.dat"), data=F.newFile("data.dat"),
setting=F.newFile("setting.dat"), setting=F.newFile("setting.dat"),
unlock=F.newFile("unlock.dat"),
} }
if F.getInfo("unlock.dat")then loadUnlock()end
if F.getInfo("data.dat")then loadStat()end if F.getInfo("data.dat")then loadStat()end
if F.getInfo("setting.dat")then if F.getInfo("setting.dat")then
loadSetting() loadSetting()
elseif system=="Android"or system=="iOS" then elseif system=="Android"or system=="iOS" then
setting.swap=false setting.swap=false
else setting.VKSwitch=true
setting.VKSwitch=false setting.vib=3
end end
math.randomseed(os.time()*626)
changeLanguage(setting.lang) changeLanguage(setting.lang)
changeBlockSkin(setting.skin) changeBlockSkin(setting.skin)

View File

@@ -4,6 +4,7 @@ local function score(P)
local F=false local F=false
if P.modeData.point<70 then--if Less then MM if P.modeData.point<70 then--if Less then MM
local R=#P.cleared local R=#P.cleared
if R==0 then return end
if R==4 then R=10 end if R==4 then R=10 end
P.modeData.point=P.modeData.point+R P.modeData.point=P.modeData.point+R
P.modeData.event=sectionName[int(P.modeData.point*.1)+1] P.modeData.event=sectionName[int(P.modeData.point*.1)+1]
@@ -12,14 +13,14 @@ end
return{ return{
name={ name={
"", "",
"", "",
"GM", "GrandMaster",
}, },
level={ level={
"", "GM",
"", "GM",
"", "GM",
}, },
info={ info={
"成为方块大师", "成为方块大师",
@@ -47,6 +48,7 @@ return{
}, },
load=function() load=function()
newPlayer(1,340,15) newPlayer(1,340,15)
players[1].modeData.event="M7"
end, end,
mesDisp=function(P,dx,dy) mesDisp=function(P,dx,dy)
mDraw(drawableText.line,-82,300) mDraw(drawableText.line,-82,300)

View File

@@ -66,7 +66,7 @@ return{
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end, scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])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[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P) getRank=function(P)
local W=P.modedata.event local W=P.modeData.event
return W>100 and 4 or W>=80 and 3 or W>=50 and 2 or W>=20 and 1 or W>=5 and 0 return W>100 and 4 or W>=80 and 3 or W>=50 and 2 or W>=20 and 1 or W>=5 and 0
end, end,
} }

View File

@@ -79,7 +79,7 @@ return{
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end, scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])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[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P) getRank=function(P)
local W=P.modedata.event local W=P.modeData.event
return W>40 and 4 or W>=30 and 3 or W>=20 and 2 or W>=10 and 1 or W>=5 and 0 return W>40 and 4 or W>=30 and 3 or W>=20 and 2 or W>=10 and 1 or W>=5 and 0
end, end,
} }

View File

@@ -34,8 +34,10 @@ return{
newPlayer(1,340,15) newPlayer(1,340,15)
end, end,
mesDisp=function(P,dx,dy) mesDisp=function(P,dx,dy)
setFont(50) setFont(60)
mStr("UNFINISHED",150,100) for i=1,5 do
mStr("UNFINISHED",120+10*i,100+50*i)
end
end, end,
score=function(P)return{P.modeData.event,P.stat.extraRate}end, score=function(P)return{P.modeData.event,P.stat.extraRate}end,
scoreDisp=function(D)return D[1].."Stage "..format("%.2f",D[2]).."%"end, scoreDisp=function(D)return D[1].."Stage "..format("%.2f",D[2]).."%"end,

View File

@@ -1,3 +1,4 @@
local min=math.min
return{ return{
name={ name={
"隐形", "隐形",
@@ -33,7 +34,7 @@ return{
mStr(P.stat.row,-82,220) mStr(P.stat.row,-82,220)
mStr(P.stat.clear_4,-82,340) mStr(P.stat.clear_4,-82,340)
end, end,
score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}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, scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P) getRank=function(P)

View File

@@ -1,3 +1,4 @@
local min=math.min
return{ return{
name={ name={
"隐形", "隐形",
@@ -35,7 +36,7 @@ return{
mStr(P.stat.row,-82,220) mStr(P.stat.row,-82,220)
mStr(P.stat.clear_4,-82,340) mStr(P.stat.clear_4,-82,340)
end, end,
score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}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, scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P) getRank=function(P)

View File

@@ -1,3 +1,4 @@
local min=math.min
return{ return{
name={ name={
"隐形", "隐形",
@@ -35,7 +36,7 @@ return{
mStr(P.stat.row,-82,220) mStr(P.stat.row,-82,220)
mStr(P.stat.clear_4,-82,340) mStr(P.stat.clear_4,-82,340)
end, end,
score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}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, scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P) getRank=function(P)

View File

@@ -1,3 +1,4 @@
local min=math.min
return{ return{
name={ name={
"隐形", "隐形",
@@ -34,7 +35,7 @@ return{
mStr(P.stat.row,-82,220) mStr(P.stat.row,-82,220)
mStr(P.stat.clear_4,-82,340) mStr(P.stat.clear_4,-82,340)
end, end,
score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}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, scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P) getRank=function(P)

View File

@@ -1,3 +1,4 @@
local min=math.min
return{ return{
name={ name={
"隐形", "隐形",
@@ -36,7 +37,7 @@ return{
mStr(P.stat.row,-82,220) mStr(P.stat.row,-82,220)
mStr(P.stat.clear_4,-82,340) mStr(P.stat.clear_4,-82,340)
end, end,
score=function(P)return{P.stat.row<=200 and P.stat.row or 200,P.stat.time}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, scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P) getRank=function(P)

View File

@@ -1,4 +1,4 @@
local rnd=math.random local rnd,min=math.random,math.min
local function check_c4w(P) local function check_c4w(P)
for i=1,#P.cleared do for i=1,#P.cleared do
P.field[#P.field+1]=getNewRow(10) P.field[#P.field+1]=getNewRow(10)
@@ -65,7 +65,7 @@ return{
mDraw(drawableText.combo,-82,358) mDraw(drawableText.combo,-82,358)
mDraw(drawableText.mxcmb,-82,450) mDraw(drawableText.mxcmb,-82,450)
end, end,
score=function(P)return{P.combo<=100 and P.combo or 100,P.stat.time}end, score=function(P)return{min(P.combo,100),P.stat.time}end,
scoreDisp=function(D)return D[1].." Combo "..toTime(D[2])end, scoreDisp=function(D)return D[1].." Combo "..toTime(D[2])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[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P) getRank=function(P)

View File

@@ -1,4 +1,4 @@
local rnd=math.random local rnd,min=math.random,math.min
local function check_c4w(P) local function check_c4w(P)
for i=1,#P.cleared do for i=1,#P.cleared do
P.field[#P.field+1]=getNewRow(10) P.field[#P.field+1]=getNewRow(10)
@@ -63,7 +63,7 @@ return{
mDraw(drawableText.combo,-82,358) mDraw(drawableText.combo,-82,358)
mDraw(drawableText.mxcmb,-82,450) mDraw(drawableText.mxcmb,-82,450)
end, end,
score=function(P)return{P.modeData.point<=100 and P.modeData.point or 100,P.stat.time}end, score=function(P)return{min(P.modeData.point,100),P.stat.time}end,
scoreDisp=function(D)return D[1].." Combo "..toTime(D[2])end, scoreDisp=function(D)return D[1].." Combo "..toTime(D[2])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[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P) getRank=function(P)

View File

@@ -40,6 +40,7 @@ return{
target=10,dropPiece=check_LVup, target=10,dropPiece=check_LVup,
bg="rgb",bgm="rockblock", bg="rgb",bgm="rockblock",
}, },
slowmark=true,
load=function() load=function()
newPlayer(1,340,15) newPlayer(1,340,15)
end, end,

View File

@@ -1,3 +1,4 @@
local min=math.min
return{ return{
name={ name={
"干旱", "干旱",
@@ -31,7 +32,7 @@ return{
local R=100-P.stat.row local R=100-P.stat.row
mStr(R>=0 and R or 0,-82,280) mStr(R>=0 and R or 0,-82,280)
end, end,
score=function(P)return{P.stat.row<=100 and P.stat.row or 100,P.stat.time}end, score=function(P)return{min(P.stat.row,100),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end, scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P) getRank=function(P)

View File

@@ -1,3 +1,4 @@
local min=math.min
return{ return{
name={ name={
"干旱", "干旱",
@@ -31,7 +32,7 @@ return{
local R=100-P.stat.row local R=100-P.stat.row
mStr(R>=0 and R or 0,-82,280) mStr(R>=0 and R or 0,-82,280)
end, end,
score=function(P)return{P.stat.row<=100 and P.stat.row or 100,P.stat.time}end, score=function(P)return{min(P.stat.row,100),P.stat.time}end,
scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end, scoreDisp=function(D)return D[1].." Lines "..toTime(D[2])end,
comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end, comp=function(a,b)return a[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P) getRank=function(P)

View File

@@ -32,7 +32,7 @@ return{
mDraw(drawableText.eff,-82,425) mDraw(drawableText.eff,-82,425)
end, end,
score=function(P)return{P.stat.score}end, score=function(P)return{P.stat.score}end,
scoreDisp=function(D)return D[1]end, scoreDisp=function(D)return tostring(D[1])end,
comp=function(a,b)return a[1]>b[1]end, comp=function(a,b)return a[1]>b[1]end,
getRank=function(P) getRank=function(P)
local L=P.stat.row local L=P.stat.row

View File

@@ -34,9 +34,10 @@ return{
env={ env={
drop=.5,fall=30, drop=.5,fall=30,
target=50,dropPiece=check, target=50,dropPiece=check,
mindas=7,minarr=1, mindas=7,minarr=1,minsdarr=1,
bg="strap",bgm="race", bg="strap",bgm="race",
}, },
slowmark=true,
load=function() load=function()
newPlayer(1,340,15) newPlayer(1,340,15)
end, end,

View File

@@ -33,9 +33,11 @@ return{
env={ env={
fall=30, fall=30,
target=10,dropPiece=check_LVup, target=10,dropPiece=check_LVup,
mindas=7,minarr=1, mindas=7,minarr=1,minsdarr=1,
minsdarr=1,
bg="strap",bgm="way", bg="strap",bgm="way",
}, },
slowmark=true,
load=function() load=function()
newPlayer(1,340,15) newPlayer(1,340,15)
end, end,

View File

@@ -59,6 +59,7 @@ return{
freshLimit=15, freshLimit=15,
bg="game2",bgm="secret7th", bg="game2",bgm="secret7th",
}, },
slowmark=true,
load=function() load=function()
newPlayer(1,340,15) newPlayer(1,340,15)
end, end,
@@ -74,12 +75,12 @@ return{
return a[1]>b[1]or(a[1]==b[1]and(a[2]<b[2]or a[2]==b[2]and a[3]<b[3])) return a[1]>b[1]or(a[1]==b[1]and(a[2]<b[2]or a[2]==b[2]and a[3]<b[3]))
end, end,
getRank=function(P) getRank=function(P)
local L=P.stat.row local L=P.stat.techrash
local S=P.modeData.point local S=P.modeData.point
if S==500 then if S==500 then
return return
L<=260 and 5 or L>=30 and 5 or
L<=320 and 4 or L>=25 and 4 or
3 3
else else
return return

View File

@@ -63,6 +63,7 @@ return{
freshLimit=15, freshLimit=15,
bg="strap",bgm="secret8th", bg="strap",bgm="secret8th",
}, },
slowmark=true,
load=function() load=function()
newPlayer(1,340,15) newPlayer(1,340,15)
end, end,
@@ -78,19 +79,19 @@ return{
return a[1]>b[1]or(a[1]==b[1]and(a[2]<b[2]or a[2]==b[2]and a[3]<b[3])) return a[1]>b[1]or(a[1]==b[1]and(a[2]<b[2]or a[2]==b[2]and a[3]<b[3]))
end, end,
getRank=function(P) getRank=function(P)
local L=P.stat.row local L=P.stat.techrash
local S=P.modeData.point local S=P.modeData.point
if S==500 then if S==500 then
return return
L<=250 and 5 or L>=30 and 5 or
L<=300 and 4 or L>=25 and 4 or
3 3
else else
return return
S>=420 and 3 or S>=420 and 3 or
S>=250 and 2 or S>=250 and 2 or
S>=120 and 1 or S>=120 and 1 or
L>=30 and 0 S>=30 and 0
end end
end, end,
} }

View File

@@ -59,6 +59,7 @@ return{
easyFresh=false,bone=true, easyFresh=false,bone=true,
bg="none",bgm="shining terminal", bg="none",bgm="shining terminal",
}, },
slowmark=true,
load=function() load=function()
newPlayer(1,340,15) newPlayer(1,340,15)
end, end,

View File

@@ -37,11 +37,9 @@ return{
newPlayer(1,340,15) newPlayer(1,340,15)
end, end,
mesDisp=function(P,dx,dy) mesDisp=function(P,dx,dy)
mDraw(drawableText.line,-82,300) setFont(65)
mDraw(drawableText.techrash,-82,420) mStr(P.modeData.event,-82,310)
setFont(75) mDraw(drawableText.wave,-82,375)
mStr(P.stat.row,-82,220)
mStr(P.stat.clear_4,-82,340)
end, end,
score=function(P)return{P.modeData.event,P.stat.time}end, score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end, scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,

View File

@@ -42,11 +42,9 @@ return{
newPlayer(1,340,15) newPlayer(1,340,15)
end, end,
mesDisp=function(P,dx,dy) mesDisp=function(P,dx,dy)
mDraw(drawableText.line,-82,300) setFont(65)
mDraw(drawableText.techrash,-82,420) mStr(P.modeData.event,-82,310)
setFont(75) mDraw(drawableText.wave,-82,375)
mStr(P.stat.row,-82,220)
mStr(P.stat.clear_4,-82,340)
end, end,
score=function(P)return{P.modeData.event,P.stat.time}end, score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end, scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,

View File

@@ -38,11 +38,9 @@ return{
newPlayer(1,340,15) newPlayer(1,340,15)
end, end,
mesDisp=function(P,dx,dy) mesDisp=function(P,dx,dy)
mDraw(drawableText.line,-82,300) setFont(65)
mDraw(drawableText.techrash,-82,420) mStr(P.modeData.event,-82,310)
setFont(75) mDraw(drawableText.wave,-82,375)
mStr(P.stat.row,-82,220)
mStr(P.stat.clear_4,-82,340)
end, end,
score=function(P)return{P.modeData.event,P.stat.time}end, score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end, scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,

View File

@@ -42,11 +42,9 @@ return{
newPlayer(1,340,15) newPlayer(1,340,15)
end, end,
mesDisp=function(P,dx,dy) mesDisp=function(P,dx,dy)
mDraw(drawableText.line,-82,300) setFont(65)
mDraw(drawableText.techrash,-82,420) mStr(P.modeData.event,-82,310)
setFont(75) mDraw(drawableText.wave,-82,375)
mStr(P.stat.row,-82,220)
mStr(P.stat.clear_4,-82,340)
end, end,
score=function(P)return{P.modeData.event,P.stat.time}end, score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end, scoreDisp=function(D)return D[1].." Waves "..toTime(D[2])end,

View File

@@ -74,7 +74,7 @@ return{
mesDisp=function(P,dx,dy) mesDisp=function(P,dx,dy)
setFont(35) setFont(35)
mStr(#players.alive.."/49",-82,175) mStr(#players.alive.."/49",-82,175)
mStr(P.ko,-70,215) mStr(P.modeData.point,-70,215)
gc.draw(drawableText.ko,-127,225) gc.draw(drawableText.ko,-127,225)
setFont(20) setFont(20)
gc.setColor(1,.5,0,.6) gc.setColor(1,.5,0,.6)
@@ -86,11 +86,11 @@ return{
gc.draw(badgeIcon,16*i-138,260) gc.draw(badgeIcon,16*i-138,260)
end end
end, end,
score=function(P)return{P.rank,P.ko}end, score=function(P)return{P.modeData.event,P.modeData.point}end,
scoreDisp=function(D)return"NO."..D[1].." KO:"..D[2]end, scoreDisp=function(D)return"NO."..D[1].." KO:"..D[2]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[1]<b[1]or a[1]==b[1]and a[2]>b[2]end,
getRank=function(P) getRank=function(P)
local R=P.rank local R=P.modeData.event
return return
R==1 and 5 or R==1 and 5 or
R<=3 and 4 or R<=3 and 4 or

View File

@@ -74,7 +74,7 @@ return{
mesDisp=function(P,dx,dy) mesDisp=function(P,dx,dy)
setFont(35) setFont(35)
mStr(#players.alive.."/49",-82,175) mStr(#players.alive.."/49",-82,175)
mStr(P.ko,-70,215) mStr(P.modeData.point,-70,215)
gc.draw(drawableText.ko,-127,225) gc.draw(drawableText.ko,-127,225)
setFont(20) setFont(20)
gc.setColor(1,.5,0,.6) gc.setColor(1,.5,0,.6)
@@ -86,11 +86,11 @@ return{
gc.draw(badgeIcon,16*i-138,260) gc.draw(badgeIcon,16*i-138,260)
end end
end, end,
score=function(P)return{P.rank,P.ko}end, score=function(P)return{P.modeData.event,P.modeData.point}end,
scoreDisp=function(D)return"NO."..D[1].." KO:"..D[2]end, scoreDisp=function(D)return"NO."..D[1].." KO:"..D[2]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[1]<b[1]or a[1]==b[1]and a[2]>b[2]end,
getRank=function(P) getRank=function(P)
local R=P.rank local R=P.modeData.event
return return
R==1 and 5 or R==1 and 5 or
R==2 and 4 or R==2 and 4 or

View File

@@ -74,7 +74,7 @@ return{
mesDisp=function(P,dx,dy) mesDisp=function(P,dx,dy)
setFont(35) setFont(35)
mStr(#players.alive.."/49",-82,175) mStr(#players.alive.."/49",-82,175)
mStr(P.ko,-70,215) mStr(P.modeData.point,-70,215)
gc.draw(drawableText.ko,-127,225) gc.draw(drawableText.ko,-127,225)
setFont(20) setFont(20)
gc.setColor(1,.5,0,.6) gc.setColor(1,.5,0,.6)
@@ -86,11 +86,11 @@ return{
gc.draw(badgeIcon,16*i-138,260) gc.draw(badgeIcon,16*i-138,260)
end end
end, end,
score=function(P)return{P.rank,P.ko}end, score=function(P)return{P.modeData.event,P.modeData.point}end,
scoreDisp=function(D)return"NO."..D[1].." KO:"..D[2]end, scoreDisp=function(D)return"NO."..D[1].." KO:"..D[2]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[1]<b[1]or a[1]==b[1]and a[2]>b[2]end,
getRank=function(P) getRank=function(P)
local R=P.rank local R=P.modeData.event
return return
R==1 and 5 or R==1 and 5 or
R==2 and 4 or R==2 and 4 or

View File

@@ -74,7 +74,7 @@ return{
mesDisp=function(P,dx,dy) mesDisp=function(P,dx,dy)
setFont(35) setFont(35)
mStr(#players.alive.."/99",-82,175) mStr(#players.alive.."/99",-82,175)
mStr(P.ko,-70,215) mStr(P.modeData.point,-70,215)
gc.draw(drawableText.ko,-127,225) gc.draw(drawableText.ko,-127,225)
setFont(20) setFont(20)
gc.setColor(1,.5,0,.6) gc.setColor(1,.5,0,.6)
@@ -86,11 +86,11 @@ return{
gc.draw(badgeIcon,16*i-138,260) gc.draw(badgeIcon,16*i-138,260)
end end
end, end,
score=function(P)return{P.rank,P.ko}end, score=function(P)return{P.modeData.event,P.modeData.point}end,
scoreDisp=function(D)return"NO."..D[1].." KO:"..D[2]end, scoreDisp=function(D)return"NO."..D[1].." KO:"..D[2]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[1]<b[1]or a[1]==b[1]and a[2]>b[2]end,
getRank=function(P) getRank=function(P)
local R=P.rank local R=P.modeData.event
return return
R==1 and 5 or R==1 and 5 or
R<=3 and 4 or R<=3 and 4 or

View File

@@ -74,7 +74,7 @@ return{
mesDisp=function(P,dx,dy) mesDisp=function(P,dx,dy)
setFont(35) setFont(35)
mStr(#players.alive.."/99",-82,175) mStr(#players.alive.."/99",-82,175)
mStr(P.ko,-70,215) mStr(P.modeData.point,-70,215)
gc.draw(drawableText.ko,-127,225) gc.draw(drawableText.ko,-127,225)
setFont(20) setFont(20)
gc.setColor(1,.5,0,.6) gc.setColor(1,.5,0,.6)
@@ -86,11 +86,11 @@ return{
gc.draw(badgeIcon,16*i-138,260) gc.draw(badgeIcon,16*i-138,260)
end end
end, end,
score=function(P)return{P.rank,P.ko}end, score=function(P)return{P.modeData.event,P.modeData.point}end,
scoreDisp=function(D)return"NO."..D[1].." KO:"..D[2]end, scoreDisp=function(D)return"NO."..D[1].." KO:"..D[2]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[1]<b[1]or a[1]==b[1]and a[2]>b[2]end,
getRank=function(P) getRank=function(P)
local R=P.rank local R=P.modeData.event
return return
R==1 and 5 or R==1 and 5 or
R<=3 and 4 or R<=3 and 4 or

View File

@@ -58,7 +58,7 @@ return{
if L[n]then if L[n]then
newPlayer(n,46*i-36,97*j-72,.068,AITemplate("9S",rnd(4,6))) newPlayer(n,46*i-36,97*j-72,.068,AITemplate("9S",rnd(4,6)))
else else
newPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(4,6)-1,LV+1,true,LV*10000)) newPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(4,6)-1,4,true,30000))
end end
n=n+1 n=n+1
end end end end
@@ -66,7 +66,7 @@ return{
if L[n]then if L[n]then
newPlayer(n,46*i+264,97*j-72,.068,AITemplate("9S",rnd(4,6))) newPlayer(n,46*i+264,97*j-72,.068,AITemplate("9S",rnd(4,6)))
else else
newPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(4,6)-1,LV+1,true,LV*10000)) newPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(4,6)-1,4,true,30000))
end end
n=n+1 n=n+1
end end end end
@@ -74,7 +74,7 @@ return{
mesDisp=function(P,dx,dy) mesDisp=function(P,dx,dy)
setFont(35) setFont(35)
mStr(#players.alive.."/99",-82,175) mStr(#players.alive.."/99",-82,175)
mStr(P.ko,-70,215) mStr(P.modeData.point,-70,215)
gc.draw(drawableText.ko,-127,225) gc.draw(drawableText.ko,-127,225)
setFont(20) setFont(20)
gc.setColor(1,.5,0,.6) gc.setColor(1,.5,0,.6)
@@ -86,11 +86,11 @@ return{
gc.draw(badgeIcon,16*i-138,260) gc.draw(badgeIcon,16*i-138,260)
end end
end, end,
score=function(P)return{P.rank,P.ko}end, score=function(P)return{P.modeData.event,P.modeData.point}end,
scoreDisp=function(D)return"NO."..D[1].." KO:"..D[2]end, scoreDisp=function(D)return"NO."..D[1].." KO:"..D[2]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[1]<b[1]or a[1]==b[1]and a[2]>b[2]end,
getRank=function(P) getRank=function(P)
local R=P.rank local R=P.modeData.event
return return
R==1 and 5 or R==1 and 5 or
R==2 and 4 or R==2 and 4 or

View File

@@ -41,7 +41,7 @@ return{
mDraw(drawableText.tsd,-82,407) mDraw(drawableText.tsd,-82,407)
end, end,
score=function(P)return{P.modeData.event,P.stat.time}end, score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return"NO."..D[1].." KO:"..D[2]end, scoreDisp=function(D)return D[1].."TSD "..toTime(D[2])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[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P) getRank=function(P)
local T=P.modeData.event local T=P.modeData.event

View File

@@ -41,7 +41,7 @@ return{
mDraw(drawableText.tsd,-82,407) mDraw(drawableText.tsd,-82,407)
end, end,
score=function(P)return{P.modeData.event,P.stat.time}end, score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return"NO."..D[1].." KO:"..D[2]end, scoreDisp=function(D)return D[1].."TSD "..toTime(D[2])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[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P) getRank=function(P)
local T=P.modeData.event local T=P.modeData.event

View File

@@ -41,7 +41,7 @@ return{
mDraw(drawableText.tsd,-82,407) mDraw(drawableText.tsd,-82,407)
end, end,
score=function(P)return{P.modeData.event,P.stat.time}end, score=function(P)return{P.modeData.event,P.stat.time}end,
scoreDisp=function(D)return"NO."..D[1].." KO:"..D[2]end, scoreDisp=function(D)return D[1].."TSD "..toTime(D[2])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[1]>b[1]or a[1]==b[1]and a[2]<b[2]end,
getRank=function(P) getRank=function(P)
local T=P.modeData.event local T=P.modeData.event

View File

@@ -1,3 +1,4 @@
local gc=love.graphics
return{ return{
name={ name={
"限时打分", "限时打分",
@@ -33,7 +34,7 @@ return{
gc.arc("fill",-40,100,50,0,1) gc.arc("fill",-40,100,50,0,1)
end, end,
score=function(P)return{P.score}end, score=function(P)return{P.score}end,
scoreDisp=function(D)return D[1]end, scoreDisp=function(D)return tostring(D[1])end,
comp=function(a,b)return a[1]>b[1]end, comp=function(a,b)return a[1]>b[1]end,
getRank=function(P) getRank=function(P)
local T=P.stat.score local T=P.stat.score

View File

@@ -30,7 +30,7 @@ return{
mStr(R>=0 and R or 0,-82,280) mStr(R>=0 and R or 0,-82,280)
end, end,
score=function(P)return{P.stat.score}end, score=function(P)return{P.stat.score}end,
scoreDisp=function(D)return D[1]end, scoreDisp=function(D)return tostring(D[1])end,
comp=function(a,b)return a[1]>b[1]end, comp=function(a,b)return a[1]>b[1]end,
getRank=function(P) getRank=function(P)
local T=P.stat.score local T=P.stat.score

170
paint.lua
View File

@@ -1,12 +1,11 @@
local gc=love.graphics local gc=love.graphics
local setFont=setFont local setFont=setFont
local int,abs,rnd,max,min,sin=math.floor,math.abs,math.random,math.max,math.min,math.sin local int,ceil,rnd,max,min,sin=math.floor,math.ceil,math.random,math.max,math.min,math.sin
local format=string.format local format=string.format
local Timer=love.timer.getTime local Timer=love.timer.getTime
local scr=scr local scr=scr
local modeRankColor={ local modeRankColor={
[0]=color.darkGrey, --Not pass
color.bronze, --Rank1 color.bronze, --Rank1
color.lightGrey, --Rank2 color.lightGrey, --Rank2
color.lightYellow, --Rank3 color.lightYellow, --Rank3
@@ -31,8 +30,6 @@ local function stencil_miniTitle()
end end
end end
FX_BGblock={tm=150,next=7,ct=0,list={}}--Falling tetrominos on background
for _=1,16 do FX_BGblock.list[_]={v=0}end
FX_attack={}--Attack beam FX_attack={}--Attack beam
FX_badge={}--Badge thrown FX_badge={}--Badge thrown
sysFX={} sysFX={}
@@ -61,21 +58,19 @@ end
local function drawVirtualkey() local function drawVirtualkey()
local a=setting.VKAlpha*.1 local a=setting.VKAlpha*.1
for i=1,#virtualkey do for i=1,#virtualkey do
if i~=9 or modeEnv.Fkey then local B=virtualkey[i]
local B=virtualkey[i] if B.ava then
if B.ava then local _=virtualkeyDown[i]and gc.setColor(.7,.7,.7,a)or gc.setColor(1,1,1,a)--Dark magic
local _=virtualkeyDown[i]and gc.setColor(.7,.7,.7,a)or gc.setColor(1,1,1,a)--Dark magic gc.setLineWidth(B.r*.07)
gc.setLineWidth(B.r*.07) local ΔY=virtualkeyPressTime[i]
local ΔY=virtualkeyPressTime[i] gc.circle("line",B.x,B.y+ΔY,B.r)--Outline circle
gc.circle("line",B.x,B.y+ΔY,B.r)--Outline circle if setting.VKIcon then
if setting.VKIcon then gc.draw(VKIcon[i],B.x,B.y+ΔY,nil,B.r*.025,nil,18,18)
gc.draw(VKIcon[i],B.x,B.y+ΔY,nil,B.r*.025,nil,18,18) end--Icon
end--Icon if ΔY>0 then
if ΔY>0 then gc.setColor(1,1,1,a*ΔY*.1)
gc.setColor(1,1,1,a*ΔY*.1) gc.circle("line",B.x,B.y,B.r*(1.4-ΔY*.04))
gc.circle("line",B.x,B.y,B.r*(1.4-ΔY*.04)) end--Ripple
end--Ripple
end
end end
end end
end end
@@ -84,6 +79,9 @@ local Pnt={BG={}}
function Pnt.BG.none() function Pnt.BG.none()
gc.clear(.15,.15,.15) gc.clear(.15,.15,.15)
end end
function Pnt.BG.black()
gc.clear()
end
function Pnt.BG.grey() function Pnt.BG.grey()
gc.clear(.3,.3,.3) gc.clear(.3,.3,.3)
end end
@@ -103,35 +101,37 @@ function Pnt.BG.rgb()
end end
function Pnt.BG.strap() function Pnt.BG.strap()
gc.setColor(1,1,1) gc.setColor(1,1,1)
local x=Timer()%32*40 local x=Timer()%16*-64
gc.draw(background2,x,0,nil,10) ::L::
gc.draw(background2,x-1280,0,nil,10) gc.draw(background2,x,0,nil,8,scr.h)
x=x+1024--image width*8
if x<scr.w then goto L end
end end
function Pnt.BG.flink() function Pnt.BG.flink()
local t=.13-Timer()%3%1.7 local t=.13-Timer()%3%1.7
if t<.25 then if t<.25 then gc.clear(t,t,t)
gc.clear(t,t,t) else gc.clear(0,0,0)
else
gc.clear(0,0,0)
end end
end end
function Pnt.BG.game1() function Pnt.BG.game1()
gc.setColor(1,1,1) gc.setColor(1,1,1)
gc.draw(background1,640,360,Timer()*.15,12,nil,64,64) gc.draw(background1,scr.w*.5,scr.h*.5,Timer()*.15,scr.rad*.0625,nil,16,16)
end--Rainbow end--Rainbow
function Pnt.BG.game2() function Pnt.BG.game2()
gc.setColor(1,.5,.5) gc.setColor(1,.5,.5)
gc.draw(background1,640,360,Timer()*.2,12,nil,64,64) gc.draw(background1,scr.w*.5,scr.h*.5,Timer()*.15,scr.rad*.0625,nil,16,16)
end--Red rainbow end--Red rainbow
function Pnt.BG.game3() function Pnt.BG.game3()
gc.setColor(.6,.6,1) gc.setColor(.6,.6,1)
gc.draw(background1,640,360,Timer()*.25,12,nil,64,64) gc.draw(background1,scr.w*.5,scr.h*.5,Timer()*.15,scr.rad*.0625,nil,16,16)
end--Blue rainbow end--Blue rainbow
function Pnt.BG.game4() function Pnt.BG.game4()
gc.setColor(.1,.5,.5) gc.setColor(.1,.5,.5)
local x=Timer()%4*320 local x=Timer()%8*-128
gc.draw(background2,x,0,nil,10) ::L::
gc.draw(background2,x-1280,0,nil,10) gc.draw(background2,x,0,nil,8,scr.h)
x=x+1024--image width*8
if x<scr.w then goto L end
end--Fast strap end--Fast strap
function Pnt.BG.game5() function Pnt.BG.game5()
local t=2.5-Timer()%20%6%2.5 local t=2.5-Timer()%20%6%2.5
@@ -149,16 +149,19 @@ function Pnt.BG.game6()
local r=7-int(Timer()*.5)%7 local r=7-int(Timer()*.5)%7
gc.draw(miniBlock[r],640,360,Timer()%3.1416*6,400,400,scs[2*r]-.5,#blocks[r][0]-scs[2*r-1]+.5) gc.draw(miniBlock[r],640,360,Timer()%3.1416*6,400,400,scs[2*r]-.5,#blocks[r][0]-scs[2*r-1]+.5)
end--Fast lightning&spining tetromino end--Fast lightning&spining tetromino
local matrixT={}for i=0,15 do matrixT[i]={}for j=0,8 do matrixT[i][j]=love.math.noise(i,j)+2 end end local matrixT={}for i=1,20 do matrixT[i]={}for j=1,20 do matrixT[i][j]=love.math.noise(i,j)+2 end end
function Pnt.BG.matrix() function Pnt.BG.matrix()
gc.scale(scr.k)
gc.clear(.15,.15,.15) gc.clear(.15,.15,.15)
for i=0,15 do local _=ceil(scr.y/80)
for j=0,8 do for i=1,ceil(scr.x/80)do
for j=1,_ do
local t=sin(matrixT[i][j]*Timer())*.2+.2 local t=sin(matrixT[i][j]*Timer())*.2+.2
gc.setColor(1,1,1,t) gc.setColor(1,1,1,t)
gc.rectangle("fill",80*i,80*j,80,80) gc.rectangle("fill",80*i,80*j,-80,-80)
end end
end end
gc.scale(1/scr.k)
end end
function Pnt.load() function Pnt.load()
@@ -208,7 +211,9 @@ function Pnt.mode()
gc.scale(cam.zoomK) gc.scale(cam.zoomK)
gc.translate(-cam.x1,-cam.y1) gc.translate(-cam.x1,-cam.y1)
gc.scale(cam.k1) gc.scale(cam.k1)
local MM,R=modes,modeRanks local MM=modes
local R=modeRanks
setFont(30)
for _=1,#MM do for _=1,#MM do
local M=MM[_] local M=MM[_]
if R[_]then if R[_]then
@@ -225,7 +230,14 @@ function Pnt.mode()
local S=M.size local S=M.size
local d=((M.x-(cam.x1+(cam.sel and -180 or 0))/cam.k1)^2+(M.y-cam.y1/cam.k1)^2)^.55 local d=((M.x-(cam.x1+(cam.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 if d<500 then S=S*(1.25-d*0.0005) end
gc.setColor(modeRankColor[modeRanks[M.id]]) local c=modeRankColor[modeRanks[M.id]]
if c then
gc.setColor(c)
else
c=.5+sin(Timer()*6+_)*.2
S=S*(.8+c*.5)
gc.setColor(c,c,c)
end
if M.shape==1 then--Rectangle if M.shape==1 then--Rectangle
gc.rectangle("fill",M.x-S,M.y-S,2*S,2*S) gc.rectangle("fill",M.x-S,M.y-S,2*S,2*S)
if cam.sel==_ then if cam.sel==_ then
@@ -233,42 +245,73 @@ function Pnt.mode()
gc.setLineWidth(10) gc.setLineWidth(10)
gc.rectangle("line",M.x-S+5,M.y-S+5,2*S-10,2*S-10) gc.rectangle("line",M.x-S+5,M.y-S+5,2*S-10,2*S-10)
end end
elseif M.shape==2 then--Octagon elseif M.shape==2 then--diamond
gc.circle("fill",M.x,M.y,S+5,4)
if cam.sel==_ 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) gc.circle("fill",M.x,M.y,S,8)
if cam.sel==_ then if cam.sel==_ then
gc.setColor(1,1,1) gc.setColor(1,1,1)
gc.setLineWidth(10) gc.setLineWidth(10)
gc.circle("line",M.x,M.y,S-5,8) gc.circle("line",M.x,M.y,S,8)
end end
end end
if M.icon then
local i=M.icon
local l=i:getWidth()*.5
local k=S/l*.8
gc.setColor(0,0,0,2)
gc.draw(i,M.x-1,M.y-1,nil,k,nil,l,l)
gc.draw(i,M.x-1,M.y+1,nil,k,nil,l,l)
gc.draw(i,M.x+1,M.y-1,nil,k,nil,l,l)
gc.draw(i,M.x+1,M.y+1,nil,k,nil,l,l)
gc.setColor(1,1,1)
gc.draw(i,M.x,M.y,nil,k,nil,l,l)
end
end end
end end
gc.pop() gc.pop()
if cam.sel then if cam.sel then
local M=MM[cam.sel] local M=MM[cam.sel]
local lang=setting.lang local lang=setting.lang
gc.setColor(.6,.6,.6,.5) gc.setColor(.7,.7,.7,.5)
gc.rectangle("fill",920,0,360,720)--Info board gc.rectangle("fill",920,0,360,720)--Info board
gc.setColor(M.color) gc.setColor(M.color)
setFont(40) setFont(40)mStr(M.name[lang],1100,5)
mStr(M.name[lang],1030,5) setFont(30)mStr(M.level[lang],1100,50)
setFont(30)
mStr(M.level[lang],1030,50)
gc.setColor(1,1,1) gc.setColor(1,1,1)
setFont(30) setFont(28)gc.printf(M.info[lang],920,110,360,"center")
gc.printf(M.info[lang],1100-180,130,360,"center") if M.slowmark then
local L=M.records gc.draw(ctrlSpeedLimit,1230,50,nil,.4)
if L[1]then end
if M.score then
mDraw(drawableText.highScore,1100,240) mDraw(drawableText.highScore,1100,240)
gc.setColor(.3,.3,.3,.8) gc.setColor(.4,.4,.4,.8)
gc.rectangle("fill",940,290,320,280)--Highscore board gc.rectangle("fill",940,290,320,280)--Highscore board
local L=M.records
gc.setColor(1,1,1) gc.setColor(1,1,1)
setFont(23) if L[1]then
for i=1,#L do for i=1,#L do
gc.print(M.scoreDisp(L[i]),955,275+25*i) local t=M.scoreDisp(L[i])
local s=#t
local dy
if s<15 then dy=0
elseif s<25 then dy=2
else dy=4
end
setFont(int(26-s*.4))
gc.print(t,955,275+dy+25*i)
setFont(10)
local _=L[i].date
if _ then gc.print(_,1155,284+25*i)end
end
else
mDraw(drawableText.noScore,1100,370)
end end
elseif M.score then
mDraw(drawableText.noScore,1100,370)
end end
end end
if cam.keyCtrl then if cam.keyCtrl then
@@ -424,7 +467,10 @@ end
function Pnt.pause() function Pnt.pause()
Pnt.play() Pnt.play()
gc.setColor(0,0,0,pauseTimer*.015) gc.setColor(0,0,0,pauseTimer*.015)
gc.rectangle("fill",0,0,1280,720) gc.push("transform")
gc.origin()
gc.rectangle("fill",0,0,scr.w,scr.h)
gc.pop()
gc.setColor(1,1,1,pauseTimer*.02) gc.setColor(1,1,1,pauseTimer*.02)
setFont(25) setFont(25)
if pauseCount>0 then if pauseCount>0 then
@@ -449,12 +495,12 @@ end
function Pnt.setting_game() function Pnt.setting_game()
gc.setColor(1,1,1) gc.setColor(1,1,1)
mDraw(drawableText.setting_game,640,15) mDraw(drawableText.setting_game,640,15)
setFont(35) setFont(33)
mStr("DAS:"..setting.das,290,205) mStr("DAS:"..setting.das.."F",290,205)
mStr("ARR:"..setting.arr,610,205) mStr("ARR:"..setting.arr.."F",610,205)
setFont(23) setFont(22)
mStr(text.softdropdas..setting.sddas,290,323) mStr(text.softdropdas..setting.sddas.."F",290,323)
mStr(text.softdroparr..setting.sdarr,610,323) mStr(text.softdroparr..setting.sdarr.."F",610,323)
end end
function Pnt.setting_graphic() function Pnt.setting_graphic()
gc.setColor(1,1,1) gc.setColor(1,1,1)

112
parts/space.lua Normal file
View File

@@ -0,0 +1,112 @@
local gc=love.graphics
local sin,cos,rnd,min=math.sin,math.cos,math.random,math.min
local W,H,R--w,h+=100,r=real Radius
local stars={}
local planet={}
local function newPlanet()
local a=rnd()*3.142
local r=(H+W)*(rnd()*2+1)*.06
planet.r=r
planet.x=W*.5+cos(a)*(R+r)
planet.y=H*.5+sin(a)*(R+r)
planet.vx=-cos(a+rnd()-.5)*.2
planet.vy=-sin(a+rnd()-.5)*.2
planet.R=.7+rnd()*.2
planet.G=.7+rnd()*.1
end
local space={}--LIB
function space.resize(w,h)
R=((w*.5)^2+(h*.5)^2)^.5
W,H=w+100,h+100
end
function space.new()
newPlanet()
for i=1,2600,5 do
local s=0.75*2^(rnd()*1.5)
stars[i]=s --size
stars[i+1]=rnd(W) --x
stars[i+2]=rnd(H) --y
stars[i+3]=(rnd()-.5)*.05*s --vx
stars[i+4]=(rnd()-.5)*.05*s --vy
end--800 stars
end
function space.translate(dx,dy)
planet.x=planet.x+dx*.26
planet.y=planet.y+dy*.26
for i=1,2600,5 do
local s=stars[i]
stars[i+1]=stars[i+1]+dx*s
stars[i+2]=stars[i+2]+dy*s
end
end
function space.scale(k)
planet.r=planet.r*k^.15
for i=1,2600,5 do
local s=stars[i]
local x=stars[i+1]
local y=stars[i+2]
s=s*k
x=W*.5+(x-W*.5)*k
y=H*.5+(y-H*.5)*k
if k>1 then
if x%W~=x or y%H~=y then
s=.75
x=W*.5+(rnd()-.5)*W*.5
y=H*.5+(rnd()-.5)*H*.5
end
--out,new small one
elseif s<.75 then
local vx,vy
repeat
s=rnd()*.75+2.25
stars[i]=s --size
x=rnd(W) --x
y=rnd(H) --y
vx=(rnd()-.5)*.15 --vx
vy=(rnd()-.5)*.15 --vy
until x<100 or x>W-100 or y<100 or y>H-100
stars[i+3]=vx
stars[i+4]=vy
--disappear,new big one
end
stars[i]=s
stars[i+1]=x
stars[i+2]=y
end
end
function space.update(dt)
local x,y=planet.x,planet.y
planet.x=planet.x+planet.vx
planet.y=planet.y+planet.vy
if((planet.x-W*.5)^2+(planet.y-H*.5)^2)^.5>R+planet.r then
newPlanet()
end
for i=1,2600,5 do
stars[i+1]=(stars[i+1]+stars[i+3])%W
stars[i+2]=(stars[i+2]+stars[i+4])%H
end--stars moving
end
function space.draw()
if not stars[1]then return end
gc.translate(-50,-50)
gc.setLineWidth(7)
gc.setColor(planet.R,planet.G,.6,.2)
gc.circle("line",planet.x,planet.y,planet.r+1)
gc.setColor(planet.R,planet.G,.6,.5)
gc.circle("fill",planet.x,planet.y,planet.r)
gc.setColor(1,1,1)
for i=1,2600,5 do
local x,y=stars[i+1],stars[i+2]
gc.circle("fill",x,y,stars[i])
end
gc.translate(50,50)
end
function space.discard()
stars={}
planet={}
collectgarbage()
end
return space

View File

@@ -4,6 +4,7 @@ local Timer=love.timer.getTime
local int,ceil,abs,rnd,max,min=math.floor,math.ceil,math.abs,math.random,math.max,math.min local int,ceil,abs,rnd,max,min=math.floor,math.ceil,math.abs,math.random,math.max,math.min
local ins,rem=table.insert,table.remove local ins,rem=table.insert,table.remove
local format=string.format local format=string.format
local actName=actName--controllings' id
local scr=scr--screen camera local scr=scr--screen camera
-------------------------</Head>------------------------- -------------------------</Head>-------------------------
@@ -27,7 +28,7 @@ local gameEnv0={
freshLimit=1e99,easyFresh=true, freshLimit=1e99,easyFresh=true,
fine=false,fineKill=false, fine=false,fineKill=false,
target=1e99,dropPiece=NULL, target=1e99,dropPiece=NULL,
mindas=0,minarr=0, mindas=0,minarr=0,minsdarr=0,
bg="none",bgm="race" bg="none",bgm="race"
} }
local renATK={[0]=0,0,0,1,1,2,2,3,3,4,4}--3 else local renATK={[0]=0,0,0,1,1,2,2,3,3,4,4}--3 else
@@ -102,8 +103,8 @@ local TRS={
[03]={TMP1,{1,0}, {1,1}, {0,-2}, {-1,1} }, [03]={TMP1,{1,0}, {1,1}, {0,-2}, {-1,1} },
[30]={TMP1,{-1,0}, {-1,-1},{0,2}, {-1,2} }, [30]={TMP1,{-1,0}, {-1,-1},{0,2}, {-1,2} },
[12]={TMP1,{1,0}, {1,-1}, {0,2}, {1,2}, {1,1} }, [12]={TMP1,{1,0}, {1,-1}, {0,2}, {1,2}, {1,1} },
[21]={TMP1,{-1,0}, {-1,1}, {0,-2}, {-1,-2},{-1,-1} }, [21]={TMP1,{-1,0}, {-1,-1},{-1,1}, {0,-2}, {-1,-2},{-1,-1} },
[32]={TMP1,{-1,0}, {-1,-1},{1,0}, {0,2}, {-1,2} }, [32]={TMP1,{-1,0}, {-1,-1},{-1,1}, {1,0}, {0,2}, {-1,2} },
[23]={TMP1,{1,0}, {1,1}, {-1,0}, {0,-2}, {1,-2} }, [23]={TMP1,{1,0}, {1,1}, {-1,0}, {0,-2}, {1,-2} },
[02]={TMP1,{1,0}, {-1,0}, {0,-1}, {0,1} }, [02]={TMP1,{1,0}, {-1,0}, {0,-1}, {0,1} },
[20]={TMP1,{-1,0}, {1,0}, {0,1}, {0,-1} }, [20]={TMP1,{-1,0}, {1,0}, {0,1}, {0,-1} },
@@ -115,10 +116,10 @@ local TRS={
[10]={TMP1,{1,0}, {1,-1}, {0,2}, {1,2} }, [10]={TMP1,{1,0}, {1,-1}, {0,2}, {1,2} },
[03]={TMP1,{1,0}, {1,1}, {0,-2}, {1,-2}, {1,-1}, {0,1} }, [03]={TMP1,{1,0}, {1,1}, {0,-2}, {1,-2}, {1,-1}, {0,1} },
[30]={TMP1,{-1,0}, {-1,-1},{0,2}, {-1,2}, {0,-1}, {-1,1} }, [30]={TMP1,{-1,0}, {-1,-1},{0,2}, {-1,2}, {0,-1}, {-1,1} },
[12]={TMP1,{1,0}, {1,-1}, {-1,0}, {0,2}, {1,2} }, [12]={TMP1,{1,0}, {1,-1}, {1,1}, {-1,0}, {0,2}, {1,2} },
[21]={TMP1,{-1,0}, {-1,1}, {1,0}, {0,-2}, {-1,-2} }, [21]={TMP1,{-1,0}, {-1,1}, {1,0}, {0,-2}, {-1,-2} },
[32]={TMP1,{-1,0}, {-1,-1},{0,2}, {-1,2}, {-1,1} }, [32]={TMP1,{-1,0}, {-1,-1},{0,2}, {-1,2}, {-1,1} },
[23]={TMP1,{1,0}, {1,1}, {0,-2}, {1,-2}, {1,-1} }, [23]={TMP1,{1,0}, {1,-1}, {1,1}, {0,-2}, {1,-2}, {1,-1} },
[02]={TMP1,{-1,0}, {1,0}, {0,-1}, {0,1} }, [02]={TMP1,{-1,0}, {1,0}, {0,-1}, {0,1} },
[20]={TMP1,{1,0}, {-1,0}, {0,1}, {0,-1} }, [20]={TMP1,{1,0}, {-1,0}, {0,1}, {0,-1} },
[13]={TMP1,{0,-1}, {1,0}, {0,1} }, [13]={TMP1,{0,-1}, {1,0}, {0,1} },
@@ -517,7 +518,7 @@ function Pdraw_small(P)
if P.result then if P.result then
gc.setColor(1,1,1,min(P.endCounter,60)*.01) gc.setColor(1,1,1,min(P.endCounter,60)*.01)
setFont(17)mStr(P.result,32,47) setFont(17)mStr(P.result,32,47)
setFont(15)mStr(P.rank,30,82) setFont(15)mStr(P.modeData.event,30,82)
end end
gc.pop() gc.pop()
gc.setCanvas() gc.setCanvas()
@@ -976,10 +977,10 @@ function player.fineError(P,rate)
P.stat.extraRate=P.stat.extraRate+rate P.stat.extraRate=P.stat.extraRate+rate
if P.human then if P.human then
if P.gameEnv.fineKill then if P.gameEnv.fineKill then
SFX("error_long") SFX("finesseError_long")
Event.lose(P) Event.lose(P)
elseif setting.fine then elseif setting.fine then
SFX("error") SFX("finesseError")
end end
elseif P.gameEnv.fineKill then elseif P.gameEnv.fineKill then
Event.lose(P) Event.lose(P)
@@ -2098,10 +2099,9 @@ function newPlayer(id,x,y,size,AIdata)
P.field,P.visTime={},{} P.field,P.visTime={},{}
P.atkBuffer={sum=0} P.atkBuffer={sum=0}
P.ko,P.badge,P.strength=0,0,0 P.badge,P.strength=0,0
P.atkMode,P.swappingAtkMode=1,20 P.atkMode,P.swappingAtkMode=1,20
P.atker,P.atking,P.lastRecv={} P.atker,P.atking,P.lastRecv={}
P.rank=nil
--Royale-related --Royale-related
P.gameEnv={}--Current game setting environment P.gameEnv={}--Current game setting environment
@@ -2113,9 +2113,11 @@ function newPlayer(id,x,y,size,AIdata)
else else
P.gameEnv[k]=v P.gameEnv[k]=v
end end
end--reset current game settings end--load game settings
P.gameEnv.das=max(P.gameEnv.das,P.gameEnv.mindas) P.gameEnv.das=max(P.gameEnv.das,P.gameEnv.mindas)
P.gameEnv.arr=max(P.gameEnv.arr,P.gameEnv.minarr) P.gameEnv.arr=max(P.gameEnv.arr,P.gameEnv.minarr)
P.gameEnv.sdarr=max(P.gameEnv.sdarr,P.gameEnv.minsdarr)
if not AIdata then P.gameEnv.next=min(P.gameEnv.next,setting.maxNext)end--AIdata is not human
P.cur={bk={{}},id=0,color=0,name=0}--shape,shapeID,colorID,nameID P.cur={bk={{}},id=0,color=0,name=0}--shape,shapeID,colorID,nameID
P.sc,P.dir,P.r,P.c={0,0},0,0,0--spinCenter,direction,row,col P.sc,P.dir,P.r,P.c={0,0},0,0,0--spinCenter,direction,row,col

View File

@@ -47,7 +47,7 @@ local sceneInit={
end end
end, end,
mode=function() mode=function()
curBG="glow" curBG="black"
BGM("blank") BGM("blank")
destroyPlayers() destroyPlayers()
local cam=mapCam local cam=mapCam
@@ -141,7 +141,7 @@ local sceneInit={
sceneTemp={ sceneTemp={
S.run, S.run,
S.game, S.game,
format("%0.1fHr",S.time*2.78e-4), format("%.1fHr",S.time*2.78e-4),
S.key, S.key,
S.rotate, S.rotate,
S.hold, S.hold,
@@ -155,8 +155,8 @@ local sceneInit={
"["..S.spin_0.."]/"..S.spin_1.."/"..S.spin_2.."/"..S.spin_3, "["..S.spin_0.."]/"..S.spin_1.."/"..S.spin_2.."/"..S.spin_3,
S.b2b.."[+"..S.b3b.."]", S.b2b.."[+"..S.b3b.."]",
S.pc, S.pc,
format("%0.2f",S.atk/S.row), format("%.2f",S.atk/S.row),
S.extraPiece.."["..(int(S.extraRate/S.piece*10000)*.01).."%]", format("%d[%.2f%%]",S.extraPiece,max(100-S.extraRate/S.piece*100,0)),
} }
end, end,
history=function() history=function()
@@ -168,17 +168,6 @@ local sceneInit={
love.event.quit() love.event.quit()
end, end,
} }
local swapDeck_data={
{4,0,1,1},{6,0,15,1},{5,0,9,1},{6,0,6,1},
{1,0,3,1},{3,0,12,1},{1,1,8,1},{2,1,4,2},
{3,2,13,2},{4,1,12,2},{5,2,1,2},{7,1,11,2},
{2,1,9,3},{3,0,6,3},{4,2,14,3},{1,0,4,4},
{7,1,1,4},{6,0,2,4},{5,2,6,4},{6,0,14,5},
{3,3,15,5},{4,0,7,6},{7,1,10,5},{5,0,2,6},
{2,1,1,7},{1,0,4,6},{4,1,13,5},{1,1,6,7},
{5,3,11,5},{3,2,11,7},{6,0,8,7},{4,2,12,8},
{7,0,8,9},{1,0,2,8},{5,2,4,8},{6,0,15,8},
}--Block id [ZSLJTOI] ,dir,x,y
local gc=love.graphics local gc=love.graphics
local swap={ local swap={
none={1,0,NULL}, none={1,0,NULL},
@@ -186,37 +175,17 @@ local swap={
fade={30,15,function(t) fade={30,15,function(t)
local t=t>15 and 2-t/15 or t/15 local t=t>15 and 2-t/15 or t/15
gc.setColor(0,0,0,t) gc.setColor(0,0,0,t)
gc.rectangle("fill",0,0,1280,720) gc.rectangle("fill",0,0,scr.w,scr.h)
end}, end},
fade_togame={120,20,function(t) fade_togame={120,20,function(t)
local t=t>20 and (120-t)/100 or t/20 local t=t>20 and (120-t)/100 or t/20
gc.setColor(0,0,0,t) gc.setColor(0,0,0,t)
gc.rectangle("fill",0,0,1280,720) gc.rectangle("fill",0,0,scr.w,scr.h)
end}, end},
slowFade={180,90,function(t) slowFade={180,90,function(t)
local t=t>90 and 2-t/90 or t/90 local t=t>90 and 2-t/90 or t/90
gc.setColor(0,0,0,t) gc.setColor(0,0,0,t)
gc.rectangle("fill",0,0,1280,720) gc.rectangle("fill",0,0,scr.w,scr.h)
end},
deck={50,8,function(t)
gc.setColor(1,1,1)
if t>8 then
local t=t<15 and 15 or t
for i=1,51-t do
local bn=swapDeck_data[i][1]
local b=blocks[bn][swapDeck_data[i][2]]
local cx,cy=swapDeck_data[i][3],swapDeck_data[i][4]
for y=1,#b do for x=1,#b[1]do
if b[y][x]then
gc.draw(blockSkin[bn],80*(cx+x-2),80*(10-cy-y),nil,8/3)
end
end end
end
end
if t<17 then
gc.setColor(1,1,1,1-(t>8 and t-8 or 8-t)*.125)
gc.rectangle("fill",0,0,1280,720)
end
end}, end},
}--Scene swapping animations }--Scene swapping animations
local backFunc={ local backFunc={

View File

@@ -77,26 +77,8 @@ clearDust:setColors(1,1,1,.5,1,1,1,0)
--Dust particles --Dust particles
gc.setDefaultFilter("linear","linear") gc.setDefaultFilter("linear","linear")
titleImage=N("/image/mess/title.png")
coloredTitleImage=N("/image/mess/title_colored.png")
dialCircle=N("/image/mess/dialCircle.png")
dialNeedle=N("/image/mess/dialNeedle.png")
badgeIcon=N("/image/mess/badge.png")
spinCenter=N("/image/mess/spinCenter.png")
batteryImage=N("/image/mess/power.png") batteryImage=N("/image/mess/power.png")
background1=N("/image/BG/bg1.jpg")
background2=N("/image/BG/bg2.png")
groupCode=N("/image/mess/groupcode.png")
payCode=N("/image/mess/paycode.png")
miya={
ch=N("/image/miya/ch.png"),
f1=N("/image/miya/f1.png"),
f2=N("/image/miya/f2.png"),
f3=N("/image/miya/f3.png"),
f4=N("/image/miya/f4.png"),
}
drawableText={ drawableText={
question=T(100,"?"), question=T(100,"?"),
bpm=T(15,"BPM"),kpm=T(15,"KPM"), bpm=T(15,"BPM"),kpm=T(15,"KPM"),

View File

@@ -1,4 +1,5 @@
local wd=love.window local wd=love.window
local gc=love.graphics
local kb=love.keyboard local kb=love.keyboard
local Timer=love.timer.getTime 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=math.floor,math.abs,math.random,math.max,math.min,math.sin
@@ -42,15 +43,40 @@ function Tmr.load()
local m=modes[L[2]] local m=modes[L[2]]
modes[L[2]]=require("modes/"..m[1]) modes[L[2]]=require("modes/"..m[1])
local M=modes[L[2]] local M=modes[L[2]]
M.saveFileName,M.x,M.y,M.shape,M.size,M.id,M.unlock=m[1],m.x,m.y,m.shape,m.size,m.id,m.unlock M.saveFileName,M.id=m[1],m.id
M.records=loadRecord(m[1]) M.x,M.y,M.size,M.shape=m.x,m.y,m.size,m.shape
M.unlock=m.unlock
M.records=loadRecord(m[1])or M.score and{}
-- M.icon=gc.newImage("image/modeIcon/"..m.icon..".png")
-- M.icon=gc.newImage("image/modeIcon/custom.png")
L[2]=L[2]+1 L[2]=L[2]+1
if L[2]>L[3]then if L[2]>L[3]then
L[1],L[2],L[3]=5,1,1 L[1],L[2],L[3]=5,1,1
end end
elseif L[1]==5 then elseif L[1]==5 then
--------------------------Loading some other things here? --------------------------Loading some other things here?
local N=gc.newImage
titleImage=N("/image/mess/title.png")
coloredTitleImage=N("/image/mess/title_colored.png")
dialCircle=N("/image/mess/dialCircle.png")
dialNeedle=N("/image/mess/dialNeedle.png")
badgeIcon=N("/image/mess/badge.png")
spinCenter=N("/image/mess/spinCenter.png")
ctrlSpeedLimit=N("/image/mess/ctrlSpeedLimit.png")
speedLimit=N("/image/mess/speedLimit.png")
background1=N("/image/BG/bg1.png")
background2=N("/image/BG/bg2.png")
groupCode=N("/image/mess/groupcode.png")
payCode=N("/image/mess/paycode.png")
miya={
ch=N("/image/miya/ch.png"),
f1=N("/image/miya/f1.png"),
f2=N("/image/miya/f2.png"),
f3=N("/image/miya/f3.png"),
f4=N("/image/miya/f4.png"),
}
-------------------------- --------------------------
L[1],L[2],L[3]=0,1,1 L[1],L[2],L[3]=0,1,1
SFX("welcome",.2) SFX("welcome",.2)
@@ -74,10 +100,17 @@ function Tmr.mode(dt)
local cam=mapCam local cam=mapCam
local F local F
local x,y,k=cam.x,cam.y,cam.k local x,y,k=cam.x,cam.y,cam.k
if kb.isDown("up", "w") then y=y-10*k;F=true end if kb.isDown("up", "w")then y=y-10*k;F=true end
if kb.isDown("down","s") then y=y+10*k;F=true end if kb.isDown("down","s")then y=y+10*k;F=true end
if kb.isDown("left","a") then x=x-10*k;F=true end if kb.isDown("left","a")then x=x-10*k;F=true end
if kb.isDown("right","d") then x=x+10*k;F=true end if kb.isDown("right","d")then x=x+10*k;F=true end
local js1=joysticks[1]
if js1 then
if js1:isDown("dpup")then y=y-10*k;F=true end
if js1:isDown("dpdown")then y=y+10*k;F=true end
if js1:isDown("dpleft")then x=x-10*k;F=true end
if js1:isDown("dpright")then x=x+10*k;F=true end
end
if F or cam.keyCtrl and(x-cam.x1)^2+(y-cam.y1)^2>2.6 then if F or cam.keyCtrl and(x-cam.x1)^2+(y-cam.y1)^2>2.6 then
if F then if F then
cam.keyCtrl=true cam.keyCtrl=true
@@ -86,12 +119,14 @@ function Tmr.mode(dt)
local MM,R=modes,modeRanks local MM,R=modes,modeRanks
for _=1,#MM do for _=1,#MM do
if R[_]then if R[_]then
local __
local M=MM[_] local M=MM[_]
local s=M.size local s=M.size
local __
if M.shape==1 then 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 __=_ end
elseif M.shape==2 then elseif M.shape==2 then
if abs(x-M.x)+abs(y-M.y)<s then __=_ 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 __=_ end
end end
if __ and cam.sel~=__ then if __ and cam.sel~=__ then
@@ -110,23 +145,24 @@ function Tmr.mode(dt)
end end
cam.x,cam.y=x,y cam.x,cam.y=x,y
--keyboard controlling --keyboard controlling
space.scale(.85+k/cam.k1*.15)
space.translate((cam.x1/cam.k1-cam.x/k)*.03*k,(cam.y1/cam.k1-cam.y/k)*.03*k)
cam.x1=cam.x1*.85+x*.15 cam.x1=cam.x1*.85+x*.15
cam.y1=cam.y1*.85+y*.15 cam.y1=cam.y1*.85+y*.15
cam.k1=cam.k1*.85+k*.15 cam.k1=cam.k1*.85+k*.15
local _=scene.swap.tar local _=scene.swap.tar
cam.zoomMethod=_=="play"and 1 or _=="mode"and 2 cam.zoomMethod=_=="play"and 1 or _=="mode"and 2
if cam.zoomMethod==1 then if cam.zoomMethod==1 then
if cam.zoomK<60 then if cam.sel 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.x=cam.x*.8+M.x*cam.k*.2 cam.y=cam.y*.8+M.y*cam.k*.2
cam.y=cam.y*.8+M.y*cam.k*.2
end
_=cam.zoomK
if _<1 then _=_*1.1 end
cam.zoomK=_*1.06
end end
_=cam.zoomK
if _<.8 then _=_*1.05 end
if _<1.1 then _=_*1.05 end
cam.zoomK=_*1.05
elseif cam.zoomMethod==2 then elseif cam.zoomMethod==2 then
cam.zoomK=cam.zoomK^.9 cam.zoomK=cam.zoomK^.9
end end

View File

@@ -1,6 +1,7 @@
local tm=love.timer local tm=love.timer
local gc=love.graphics local gc=love.graphics
local kb=love.keyboard local kb=love.keyboard
local data=love.data
local int,abs,rnd,max,min=math.floor,math.abs,math.random,math.max,math.min local int,abs,rnd,max,min=math.floor,math.abs,math.random,math.max,math.min
local sub,find,format,char,byte=string.sub,string.find,string.format,string.char,string.byte local sub,find,format,char,byte=string.sub,string.find,string.format,string.char,string.byte
local ins,rem=table.insert,table.remove local ins,rem=table.insert,table.remove
@@ -20,7 +21,7 @@ end
function toTime(s) function toTime(s)
if s<60 then if s<60 then
return format("%.3f",s) return format("%.3fs",s)
elseif s<3600 then elseif s<3600 then
return format("%d:%.2f",int(s/60),s%60) return format("%d:%.2f",int(s/60),s%60)
else else
@@ -142,10 +143,13 @@ function restoreVirtualKey()
B.y=O.y B.y=O.y
B.r=O.r B.r=O.r
end end
if not modeEnv.Fkey then
virtualkey[9].ava=false
end
end end
function copyBoard() function copyBoard()
local str="" local str=""
local H=20 local H=0
for y=20,1,-1 do for y=20,1,-1 do
for x=1,10 do for x=1,10 do
if preField[y][x]~=0 then if preField[y][x]~=0 then
@@ -156,56 +160,59 @@ function copyBoard()
end end
::L:: ::L::
for y=1,H do for y=1,H do
local L="" local S=""
for x=1,10 do local L=preField[y]
local s=preField[y][x] for x=1,10,2 do
if s>7 then s=s-1 end local H=L[x]
L=L..char(66+s) local L=L[x+1]
if H<8 then H=H+1 end
if L<8 then L=L+1 end
S=S..char(H*16+L)
end end
-- str=str..L.."\n" str=str..S
end end
love.system.setClipboardText("Techmino sketchpad:"..str) love.system.setClipboardText("Techmino sketchpad:"..data.encode("string","base64",data.compress("string","deflate",str)))
TEXT(text.copySuccess,350,360,40,"appear",.5) TEXT(text.copySuccess,350,360,40,"appear",.5)
end end
function pasteBoard() function pasteBoard()
local str=love.system.getClipboardText() local str=love.system.getClipboardText()
local len=#str local fX,fY=1,1--*ptr for Field(r*10+(c-1))
local _ local _,__
local p,P=1,10--sum,pStr,pField(r*10+(c-1)) local p=find(str,":")--ptr*
p=find(str,":") if p then str=sub(str,p+1)end
if p then str=data.decompress("string","deflate",data.decode("string","base64",str))
p=p+1 p=1
else ::LOOP::
p=find(str,"[A-N]") _=byte(str,p)--1byte
if not p then if not _ then
goto E if fX~=1 then goto ERROR
end else goto FINISH
end--int p*//head end
::L:: end--str end
_=byte(str,p) __=_%16--low4b
if P==210 then _=(_-__)/16--high4b
return if _>12 or __>12 then goto ERROR end--illegal blockid
elseif not _ then if _<9 then _=_-1 end if __<9 then __=__-1 end
if P%10~=0 then preField[fY][fX]=_;preField[fY][fX+1]=__
goto E if fX<9 then
fX=fX+2
else else
return if fY==20 then goto FINISH end
fX=1;fY=fY+1
end end
end--end check
_=_-66
if _<-1 or _>12 then
p=p+1 p=p+1
goto L goto LOOP
end--skip illegal char
if _>-2 and _<13 then ::FINISH::
if _>7 then _=_+1 end for y=fY+1,20 do
preField[int(P/10)][P%10+1]=_ for x=1,10 do
P=P+1 preField[y][x]=0
end end
p=p+1 end
goto L goto END
::E:: ::ERROR::
TEXT(text.dataCorrupted,350,360,35,"flicker",.5) TEXT(text.dataCorrupted,350,360,35,"flicker",.5)
::END::
end end
function updateStat() function updateStat()
@@ -321,7 +328,7 @@ function loadGame(M)
end end
function resetPartGameData() function resetPartGameData()
gameResult=false gameResult=false
frame=30 frame=150-setting.reTime*15
destroyPlayers() destroyPlayers()
curMode.load() curMode.load()
texts={} texts={}
@@ -345,7 +352,7 @@ function resetPartGameData()
end end
function resetGameData() function resetGameData()
gameResult=false gameResult=false
frame=0 frame=150-setting.reTime*15
garbageSpeed=1 garbageSpeed=1
pauseTime=0--Time paused pauseTime=0--Time paused
pauseCount=0--Times paused pauseCount=0--Times paused
@@ -403,22 +410,27 @@ function loadRecord(N)
setfenv(s,T) setfenv(s,T)
T[1]=s() T[1]=s()
return T[1] return T[1]
else
return{}
end end
end end
local function dumpTable(L) local function dumpTable(L)
local s="{\n" local s="{\n"
for k,v in next,L do for k,v in next,L do
local T local T
T=type(k)
if T=="number"then k="["..k.."]="
elseif T=="string"then k=k.."="
else error("Error data type!")
end
T=type(v) T=type(v)
if T=="number"then v=tostring(v) if T=="number"then v=tostring(v)
elseif T=="string"then v="\""..v.."\"" elseif T=="string"then v="\""..v.."\""
elseif T=="table"then v=dumpTable(v) elseif T=="table"then v=dumpTable(v)
else error("Error data type!") else error("Error data type!")
end end
s=s.."["..k.."]="..v..",\n" s=s..k..v..",\n"
end end
print(s)
print("---")
return s.."}" return s.."}"
end end
function saveRecord(N,L) function saveRecord(N,L)
@@ -435,6 +447,35 @@ function delRecord(N)
fs.remove(N..".dat") fs.remove(N..".dat")
end end
function saveUnlock()
local t={}
local RR=modeRanks
for i=1,#RR do
t[i]=RR[i]or"X"
end
t=concat(t,",")
local F=FILE.unlock
F:open("w")
local _=F:write(t)
F:flush()
F:close()
if not _ then
TEXT(text.unlockSavingError..mes,640,480,40,"appear",.4)
end
end
function loadUnlock()
local F=FILE.unlock
F:open("r")
local t=F:read()
F:close()
t=splitS(t,",")
for i=1,#modeRanks do
local v=toN(t[i])
if not v or v<0 or v>6 or v~=int(v)then v=false end
modeRanks[i]=v
end
end
local statOpy={ local statOpy={
"run","game","time", "run","game","time",
"extraPiece","extraRate", "extraPiece","extraRate",
@@ -448,27 +489,17 @@ function loadStat()
local F=FILE.data local F=FILE.data
F:open("r") F:open("r")
local t=F:read() local t=F:read()
t=splitS(t,"\r\n")
F:close() F:close()
t=splitS(t,"\r\n")
for i=1,#t do for i=1,#t do
local p=find(t[i],"=") local p=find(t[i],"=")
if p then if p then
local t,v=sub(t[i],1,p-1),sub(t[i],p+1) local t,v=sub(t[i],1,p-1),sub(t[i],p+1)
if t=="rank"then for i=1,#statOpy do
v=splitS(v,",") if t==statOpy[i]then
for i=1,#modeRanks do v=toN(v)if not v or v<0 then v=0 end
local v=toN(v[i]) stat[t]=v
if not v or v<0 or v>6 or v~=int(v)then v=false end break
modeRanks[i]=v
end
else
if t=="gametime"then t="time"end
for i=1,#statOpy do
if t==statOpy[i]then
v=toN(v)if not v or v<0 then v=0 end
stat[t]=v
break
end
end end
end end
end end
@@ -503,17 +534,19 @@ function loadSetting()
local F=FILE.setting local F=FILE.setting
F:open("r") F:open("r")
local t=F:read() local t=F:read()
t=splitS(t,"\r\n")
F:close() F:close()
t=splitS(t,"\r\n")
for i=1,#t do for i=1,#t do
local p=find(t[i],"=") local p=find(t[i],"=")
if p then if p then
local t,v=sub(t[i],1,p-1),sub(t[i],p+1) local t,v=sub(t[i],1,p-1),sub(t[i],p+1)
if if--10档的设置
--声音 --声音
t=="sfx"or t=="bgm"or t=="voc"or t=="stereo"or t=="sfx"or t=="bgm"or t=="voc"or t=="stereo"or
--三个触摸设置项 --三个触摸设置项
t=="VKTchW"or t=="VKCurW"or t=="VKAlpha" t=="VKTchW"or t=="VKCurW"or t=="VKAlpha"or
--重开时间
t=="reTime"
then then
v=toN(v) v=toN(v)
if v and v==int(v)and v>=0 and v<=10 then if v and v==int(v)and v>=0 and v<=10 then
@@ -528,7 +561,7 @@ function loadSetting()
--开关设置们 --开关设置们
t=="bg"or t=="bg"or
t=="ghost"or t=="center"or t=="grid"or t=="swap"or t=="ghost"or t=="center"or t=="grid"or t=="swap"or
t=="quickR"or t=="fine"or t=="bgblock"or t=="smo"or t=="quickR"or t=="fine"or t=="bgspace"or t=="smo"or
t=="VKSwitch"or t=="VKTrack"or t=="VKDodge"or t=="VKIcon" t=="VKSwitch"or t=="VKTrack"or t=="VKDodge"or t=="VKIcon"
then then
setting[t]=v=="true" setting[t]=v=="true"
@@ -569,6 +602,7 @@ end
local saveOpt={ local saveOpt={
"das","arr", "das","arr",
"sddas","sdarr", "sddas","sdarr",
"reTime",
"quickR", "quickR",
"swap", "swap",
"fine", "fine",
@@ -582,7 +616,7 @@ local saveOpt={
"fullscreen", "fullscreen",
"bg", "bg",
"bgblock", "bgspace",
"lang", "lang",
"skin", "skin",

View File

@@ -1,20 +1,20 @@
local S=[=[ local S=[=[
Patron(rmb10+): "Patron"(rmb10+):
Fireboos "Fireboos"
gggf "gggf"
Sasoric "Sasoric"
sfqr
T080 T080
Ykzl "Ykzl"
zxc "zxc"
10元
?[D*a] ?[D*a]
Future outlook: Future outlook:
New mode system with: New mode system with:
rythem mode rythem mode
combo mode combo mode
bigbang mode
puzzle mode(ttt) puzzle mode(ttt)
square mode square mode
finesse practice mode
infinite 1v1 infinite 1v1
Other: Other:
puzzle import/output(ttt) puzzle import/output(ttt)
@@ -22,7 +22,6 @@ Future outlook:
(powerinfo switch) (powerinfo switch)
virtualWidgets like joysticks virtualWidgets like joysticks
splashing block splashing block
ajustable next count
custom block color/direction custom block color/direction
custom block sequence custom block sequence
CC smarter(think of garbage buffer) CC smarter(think of garbage buffer)
@@ -31,6 +30,16 @@ Future outlook:
auto GUI position in any screen size auto GUI position in any screen size
more FXs & 3d features & animations more FXs & 3d features & animations
Encrypt source code(compile to byte code) Encrypt source code(compile to byte code)
0.8.8:
background now is cool space with planets and stars,not boring falling tetrominos!
records with date
adjustable waiting time before start
ajustable maxnext count
new error page and a new voice
tiny change in rotate system(JL pistol-spin)
marked the modes with limited das/arr
an unlock-all easter egg
bugs fixed(some mode error)
0.8.7: 0.8.7:
better user experience in mode selecting better user experience in mode selecting
support 2^n G falling speed support 2^n G falling speed
@@ -200,7 +209,7 @@ Future outlook:
bugs fixed bugs fixed
0.7.14: 0.7.14:
drawing mode in custom game drawing mode in custom game
can adjust virtual keys with mouse adjustable virtual keys with mouse
speed optimized speed optimized
rotate also create shade rotate also create shade
0.7.13+: 0.7.13+:

View File

@@ -139,19 +139,19 @@ local Widget={
setting=newButton(370,280,200,160,C.lightBlue, 45,function()scene.push()scene.swapTo("setting_game")end, nil,"music"), setting=newButton(370,280,200,160,C.lightBlue, 45,function()scene.push()scene.swapTo("setting_game")end, nil,"music"),
music= newButton(590,280,200,160,C.lightPurple, 32,function()scene.push()scene.swapTo("music")end, nil,"help"), music= newButton(590,280,200,160,C.lightPurple, 32,function()scene.push()scene.swapTo("music")end, nil,"help"),
help= newButton(150,460,200,160,C.lightYellow, 50,function()scene.push()scene.swapTo("help")end, nil,"stat"), help= newButton(150,460,200,160,C.lightYellow, 50,function()scene.push()scene.swapTo("help")end, nil,"stat"),
stat= newButton(370,460,200,160,C.lightCyan, 43,function()scene.push()scene.swapTo("stat")end, nil,"lang"), stat= newButton(370,460,200,160,C.lightCyan, 43,function()scene.push()scene.swapTo("stat")end, nil,"quit"),
quit= newButton(590,460,200,160,C.lightGrey, 55,function()VOICE("bye")scene.swapTo("quit","slowFade")end,nil,"lang"),
lang= newButton(150,610,160,100,C.lightGreen, 45,function() lang= newButton(150,610,160,100,C.lightGreen, 45,function()
setting.lang=setting.lang%#langName+1 setting.lang=setting.lang%#langName+1
changeLanguage(setting.lang) changeLanguage(setting.lang)
TEXT(text.lang,370,610,50,"appear",1.6) TEXT(text.lang,370,610,50,"appear",1.6)
end,nil,"quit"), end,nil,"play"),
quit= newButton(590,460,200,160,C.lightGrey, 55,function()VOICE("bye")scene.swapTo("quit","slowFade")end,nil,"play"),
}, },
mode={ mode={
draw= newButton(1100, 440,220,90,C.lightYellow, 40,function()scene.push()scene.swapTo("draw")end,function()return mapCam.sel~=71 and mapCam.sel~=72 end), draw= newButton(1100, 440,220,90,C.lightYellow, 40,function()scene.push()scene.swapTo("draw")end,function()return mapCam.sel~=71 and mapCam.sel~=72 end),
setting=newButton(1100, 540,220,90,C.lightGreen, 40,function()scene.push()scene.swapTo("custom")end,function()return mapCam.sel~=71 and mapCam.sel~=72 end), setting=newButton(1100, 540,220,90,C.lightGreen, 40,function()scene.push()scene.swapTo("custom")end,function()return mapCam.sel~=71 and mapCam.sel~=72 end),
start= newButton(1100, 640,220,90,C.lightGrey, 40,function()scene.push()loadGame(mapCam.sel)end,function()return not mapCam.sel end), start= newButton(1040, 655,180,80,C.lightGrey, 40,function()scene.push()loadGame(mapCam.sel)end,function()return not mapCam.sel end),
back= newButton(1205, 50, 130,80, C.white, 40,scene.back), back= newButton(1200, 655,120,80,C.white, 40,scene.back),
--function()scene.push()scene.swapTo("custom")end --function()scene.push()scene.swapTo("custom")end
}, },
music={ music={
@@ -244,16 +244,18 @@ local Widget={
SFX("blip_1",.4) SFX("blip_1",.4)
end end
end,nil,"sddasD"), end,nil,"sddasD"),
sddasD= newButton(180,340,50,50,C.white,40, function()setting.sddas=(setting.sddas-1)%11 end, nil,"sddasU"), sddasD= newButton(180,340,50,50,C.white,40, function()setting.sddas=(setting.sddas-1)%11 end, nil,"sddasU"),
sddasU= newButton(400,340,50,50,C.white,40, function()setting.sddas=(setting.sddas+1)%11 end, nil,"sdarrD"), sddasU= newButton(400,340,50,50,C.white,40, function()setting.sddas=(setting.sddas+1)%11 end, nil,"sdarrD"),
sdarrD= newButton(500,340,50,50,C.white,40, function()setting.sdarr=(setting.sdarr-1)%4 end, nil,"sdarrU"), sdarrD= newButton(500,340,50,50,C.white,40, function()setting.sdarr=(setting.sdarr-1)%4 end, nil,"sdarrU"),
sdarrU= newButton(720,340,50,50,C.white,40, function()setting.sdarr=(setting.sdarr+1)%4 end, nil,"quickR"), sdarrU= newButton(720,340,50,50,C.white,40, function()setting.sdarr=(setting.sdarr+1)%4 end, nil,"reTime"),
quickR= newSwitch(580,430,35,SETdisp("quickR"), SETrev("quickR"), nil,"swap"), reTime= newSlider(350,430,300,10,30,nil, SETdisp("reTime"), SETsto("reTime"), nil,"maxNext"),
swap= newSwitch(580,510,20,SETdisp("swap"), SETrev("swap"), nil,"fine"), maxNext=newSlider(350,510,300,6,30,nil, SETdisp("maxNext"), SETsto("maxNext"), nil,"quickR"),
fine= newSwitch(580,590,20,SETdisp("fine"), SETrev("fine"), nil,"ctrl"), quickR= newSwitch(1000,430,35, SETdisp("quickR"), SETrev("quickR"), nil,"swap"),
swap= newSwitch(1000,510,19, SETdisp("swap"), SETrev("swap"), nil,"fine"),
fine= newSwitch(1000,590,20, SETdisp("fine"), SETrev("fine"), nil,"ctrl"),
ctrl= newButton(1020,230,320,80,C.white,35,function()scene.push()scene.swapTo("setting_key")end, nil,"touch"), ctrl= newButton(1020,230,320,80,C.white,35,function()scene.push()scene.swapTo("setting_key")end, nil,"touch"),
touch= newButton(1020,340,320,80,C.white,35,function()scene.push()scene.swapTo("setting_touch")end,nil,"back"), touch= newButton(1020,340,320,80,C.white,35,function()scene.push()scene.swapTo("setting_touch")end,nil,"back"),
back= newButton(1160,600,160,160,C.white,50,scene.back,nil,"graphic"), back= newButton(1160,600,160,160,C.white,50,scene.back, nil,"graphic"),
}, },
setting_graphic={ setting_graphic={
sound= newButton(200,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_sound")end, nil,"game"), sound= newButton(200,80,240,80,C.lightCyan,35,function()scene.swapTo("setting_sound")end, nil,"game"),
@@ -273,8 +275,15 @@ local Widget={
love.resize(love.graphics.getWidth(),love.graphics.getHeight()) love.resize(love.graphics.getWidth(),love.graphics.getHeight())
end end
end,nil,"bg"), end,nil,"bg"),
bg= newSwitch(990,250,35,SETdisp("bg"),SETrev("bg"),nil,"bgblock"), bg= newSwitch(990,250,35,SETdisp("bg"),SETrev("bg"),nil,"bgspace"),
bgblock=newSwitch(990,330,35,SETdisp("bgblock"),SETrev("bgblock"),nil,"skin"),--if not setting.bgblock then for i=1,16 do FX_BGblock.list[i].v=3*FX_BGblock.list[i].v end end bgspace=newSwitch(990,330,35,SETdisp("bgspace"),function()
setting.bgspace=not setting.bgspace
if setting.bgspace then
space.new()
else
space.discard()
end
end,nil,"skin"),
skin= newButton(810,420,120,60,C.white,35,function() skin= newButton(810,420,120,60,C.white,35,function()
local _=setting.skin%8+1 local _=setting.skin%8+1
setting.skin=_ setting.skin=_