diff --git a/BGM/chlorine.ogg b/BGM/chlorine.ogg new file mode 100644 index 00000000..3bd50db6 Binary files /dev/null and b/BGM/chlorine.ogg differ diff --git a/BGM/ogg 44100Hz 0.4q 2chn b/BGM/ogg 44100Hz 0.4q 2chn deleted file mode 100644 index e69de29b..00000000 diff --git a/conf.lua b/conf.lua index 1afbc224..8f2a8fc8 100644 --- a/conf.lua +++ b/conf.lua @@ -1,10 +1,10 @@ -gameVersion="Alpha V0.8.8" +gameVersion="Alpha V0.8.9" function love.conf(t) - t.identity="Techmino"--Save directory name + t.identity="Techmino"--SaveDir name t.version="11.1" t.console=false t.gammacorrect=false - t.appendidentity=false--Search files in source before save directory + t.appendidentity=true--Search files in source before save directory t.accelerometerjoystick=false--ios/android加速度计=摇杆 t.audio.mixwithsystem=true @@ -18,11 +18,11 @@ function love.conf(t) W.fullscreentype="desktop"--"exclusive" W.fullscreen=false W.vsync=0--0:∞fps - 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.stencil=1--Bits per sample in the stencil buffer + W.msaa=false--num of samples to use with multi-sampled antialiasing + W.depth=0--bits/samp of depth buffer + W.stencil=1--bits/samp of stencil buffer W.display=1--Monitor ID - W.highdpi=false--Enable high-dpi mode for the window on a Retina display (boolean) + W.highdpi=false--High-dpi mode for the window on a Retina display W.x,W.y=nil local M=t.modules diff --git a/dataList.lua b/dataList.lua index 2a13dbf1..8109a79d 100644 --- a/dataList.lua +++ b/dataList.lua @@ -22,7 +22,12 @@ function AITemplate(type,speedLV,next,hold,node) end -------------------------------------------------- local function gameOver() + saveStat() local M=curMode + if M.pauseLimit and(pauseCount==1 and pauseTime>2.6 or pauseTime>6.26)then + TEXT(text.invalidGame,640,260,80,"flicker",.5) + return + end local R=M.getRank if R then local P=players[1] @@ -36,8 +41,8 @@ local function gameOver() local m=M.unlock[i] modeRanks[m]=modes[m].score and 0 or 6 end - saveUnlock() end + saveUnlock() end local D=M.score(P) local L=M.records diff --git a/file.lua b/file.lua new file mode 100644 index 00000000..f5aad050 --- /dev/null +++ b/file.lua @@ -0,0 +1,275 @@ +local fs=love.filesystem +local int,max,min=math.floor,math.max,math.min +local sub,find=string.sub,string.find +local toN,toS=tonumber,tostring +local concat=table.concat + +local function splitS(s,sep) + local t,n={},1 + repeat + local p=find(s,sep)or #s+1 + t[n]=sub(s,1,p-1) + n=n+1 + s=sub(s,p+#sep) + until #s==0 + return t +end + +function loadRecord(N) + local F=fs.newFile(N..".dat") + if F:open("r")then + local s=loadstring(F:read()) + local T={} + setfenv(s,T) + T[1]=s() + return T[1] + end +end +local function dumpTable(L) + local s="{\n" + for k,v in next,L do + local T + T=type(k) + if T=="number"then k="["..k.."]=" + elseif T=="string"then k=k.."=" + else error("Error data type!") + end + T=type(v) + if T=="number"then v=tostring(v) + elseif T=="string"then v="\""..v.."\"" + elseif T=="table"then v=dumpTable(v) + else error("Error data type!") + end + s=s..k..v..",\n" + end + return s.."}" +end +function saveRecord(N,L) + local F=fs.newFile(N..".dat") + F:open("w") + local _=F:write("return"..dumpTable(L)) + F:flush() + F:close() + if not _ then + TEXT(text.recSavingError..mes,640,480,40,"appear",.4) + end +end +function delRecord(N) + fs.remove(N..".dat") +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={ + "run","game","time", + "extraPiece","extraRate", + "key","rotate","hold","piece","row", + "atk","send","recv","pend", + "clear_1","clear_2","clear_3","clear_4", + "spin_0","spin_1","spin_2","spin_3", + "b2b","b3b","pc","score", +} +function loadStat() + local F=FILE.data + F:open("r") + local t=F:read() + F:close() + t=splitS(t,"\r\n") + for i=1,#t do + local p=find(t[i],"=") + if p then + local t,v=sub(t[i],1,p-1),sub(t[i],p+1) + 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 +function saveStat() + local t={} + for i=1,#statOpy do + t[i]=statOpy[i].."="..toS(stat[statOpy[i]]) + end + + t=concat(t,"\r\n") + local F=FILE.data + F:open("w") + local _=F:write(t) + F:flush() + F:close() + if not _ then + TEXT(text.statSavingError..mes,640,480,40,"appear",.4) + end +end + +function loadSetting() + local F=FILE.setting + F:open("r") + local t=F:read() + F:close() + t=splitS(t,"\r\n") + for i=1,#t do + local p=find(t[i],"=") + if p then + local t,v=sub(t[i],1,p-1),sub(t[i],p+1) + if--10档的设置 + --声音 + t=="sfx"or t=="bgm"or t=="voc"or t=="stereo"or + --三个触摸设置项 + t=="VKTchW"or t=="VKCurW"or t=="VKAlpha"or + --重开时间 + t=="reTime" + then + v=toN(v) + if v and v==int(v)and v>=0 and v<=10 then + setting[t]=v + end + elseif t=="vib"then + setting.vib=toN(v:match("[012345]"))or 0 + elseif t=="fullscreen"then + setting.fullscreen=v=="true" + love.window.setFullscreen(setting.fullscreen) + elseif + --开关设置们 + t=="bg"or + t=="ghost"or t=="center"or t=="grid"or t=="swap"or + t=="quickR"or t=="fine"or t=="bgspace"or t=="smo"or + t=="VKSwitch"or t=="VKTrack"or t=="VKDodge"or t=="VKIcon" + then + setting[t]=v=="true" + elseif t=="frameMul"then + setting.frameMul=min(max(toN(v)or 100,0),100) + elseif t=="das"or t=="arr"or t=="sddas"or t=="sdarr"then + v=toN(v)if not v or v<0 then v=0 end + setting[t]=int(v) + elseif t=="dropFX"or t=="shakeFX"or t=="atkFX"then + setting[t]=toN(v:match("[012345]"))or 0 + elseif t=="lang"then + setting[t]=toN(v:match("[123]"))or 1 + elseif t=="skin"then + setting[t]=toN(v:match("[12345678]"))or 1 + elseif t=="keymap"then + v=splitS(v,"/") + for i=1,16 do + local v1=splitS(v[i],",") + for j=1,#v1 do + setting.keyMap[i][j]=v1[j] + end + end + elseif t=="VK"then + v=splitS(v,"/") + local SK + for i=1,#v do + if v[i]then + SK=splitS(v[i],",") + local K=VK_org[i] + K.ava=SK[1]=="T" + K.x,K.y,K.r=toN(SK[2]),toN(SK[3]),toN(SK[4]) + end + end + elseif t=="lastPlay"then + v=toN(v) + mapCam.lastPlay=v and modeRanks[v]and v or 1 + end + end + end +end +local saveOpt={ + "das","arr", + "sddas","sdarr", + "reTime", + "quickR", + "swap", + "fine", + + "ghost","center", + "smo","grid", + "dropFX", + "shakeFX", + "atkFX", + "frameMul", + + "fullscreen", + "bg", + "bgspace", + "lang", + "skin", + + "sfx","bgm", + "vib","voc", + "stereo", + + "VKSwitch", + "VKTrack", + "VKDodge", + "VKTchW", + "VKCurW", + "VKIcon", + "VKAlpha", +} +function saveSetting() + local vk={}--virtualkey table + for i=1,#VK_org do + local V=VK_org[i] + vk[i]=concat({ + V.ava and"T"or"F", + int(V.x+.5), + int(V.y+.5), + V.r, + },",") + end--pre-pack virtualkey setting + local map={} + for i=1,16 do + map[i]=concat(setting.keyMap[i],",") + end + local t={ + "keymap="..toS(concat(map,"/")), + "VK="..toS(concat(vk,"/")), + "lastPlay="..mapCam.lastPlay, + } + for i=1,#saveOpt do + t[#t+1]=saveOpt[i].."="..toS(setting[saveOpt[i]]) + end + t=concat(t,"\r\n") + local F=FILE.setting + F:open("w") + local _,mes=F:write(t) + F:flush() + F:close() + if _ then + TEXT(text.settingSaved,370,330,30,"appear") + else + TEXT(text.settingSavingError.."123",370,350,20,"appear",.3) + end +end \ No newline at end of file diff --git a/font.ttf b/font.ttf index 5a44a8ba..214e8fdd 100644 Binary files a/font.ttf and b/font.ttf differ diff --git a/language/chi.lua b/language/chi.lua index e175d925..331c49a1 100644 --- a/language/chi.lua +++ b/language/chi.lua @@ -77,11 +77,11 @@ return{ setting_sound="声音设置", musicRoom="音乐室", nowPlaying="正在播放:", + unlockSavingError="解锁保存失败:", recSavingError="纪录保存失败:", + statSavingError="数据保存失败:", settingSaved="设置已保存", settingSavingError="设置保存失败:", - statSavingError="数据保存失败:", - unlockSavingError="解锁保存失败", copySuccess="已复制到剪切板", dataCorrupted="数据损坏", VKTchW="触摸点权重", @@ -90,6 +90,7 @@ return{ noScore="暂无成绩", highScore="最佳成绩", newRecord="打破纪录", + invalidGame="成绩无效", errorMsg="Techmino遇到了问题,需要重新启动.\n我们已收集了一些错误信息,你可以向作者进行反馈.", actName=actName, @@ -126,6 +127,8 @@ return{ "秘密数字:626", "CLASSIC SEXY RUSSIAN BLOCKS", "戴上耳机以获得最佳体验", + "少女祈祷中", + "少女折寿中", "LrL,RlR LLr,RRl RRR/LLL F!!",--ZSLJTTI "(第一次才准)今日幸运数字:"..math.random(100,626), }, @@ -176,12 +179,13 @@ return{ warning="禁止直接传播游戏本体", WidgetText={ main={ - lang="言/A", play="开始", setting="设置", music="音乐室", stat="统计信息", help="帮助", + qplay="快速开始", + lang="言/A", quit="退出", }, mode={ diff --git a/language/chi_full.lua b/language/chi_full.lua index 0875910a..0255c069 100644 --- a/language/chi_full.lua +++ b/language/chi_full.lua @@ -77,11 +77,11 @@ return{ setting_sound="声音设置", musicRoom="音乐室", nowPlaying="正在播放:", + unlockSavingError="解锁保存失败:", recSavingError="纪录保存失败:", + statSavingError="数据保存失败:", settingSaved="设置已保存", settingSavingError="设置保存失败:", - statSavingError="数据保存失败:", - unlockSavingError="解锁保存失败", copySuccess="已复制到剪切板", dataCorrupted="数据损坏", VKTchW="触摸点权重", @@ -90,6 +90,7 @@ return{ noScore="暂无成绩", highScore="最佳成绩", newRecord="打破纪录", + invalidGame="成绩无效", errorMsg="Techmino遇到了问题,需要重新启动.\n我们已收集了一些错误信息,你可以向作者进行反馈.", actName=actName, @@ -126,6 +127,8 @@ return{ "秘密数字:626", "CLASSIC SEXY RUSSIAN BLOCKS", "戴上耳机以获得最佳体验", + "少女祈祷中", + "少女折寿中", "LrL,RlR LLr,RRl RRR/LLL F!!",--ZSLJTTI "(第一次才准)今日幸运数字:"..math.random(100,626), }, @@ -176,12 +179,13 @@ return{ warning="禁止直接传播游戏本体", WidgetText={ main={ - lang="言/A", play="开始", setting="设置", music="音乐室", stat="统计信息", help="帮助", + qplay="快速开始", + lang="言/A", quit="退出", }, mode={ diff --git a/language/eng.lua b/language/eng.lua index a9fee3c8..68de24fb 100644 --- a/language/eng.lua +++ b/language/eng.lua @@ -75,11 +75,11 @@ return{ setting_sound="Sound setting", musicRoom="Music Room", nowPlaying="Now Playing:", - recSavingError="Failed to save record:", - settingSaved="Setting saved", - settingSavingError="Failed to save setting:", - statSavingError="Failed to save stat:", unlockSavingError="Failed to save unlock:", + recSavingError="Failed to save record:", + statSavingError="Failed to save stat:", + settingSaved="Setting Saved", + settingSavingError="Failed to save setting:", copySuccess="Copy Success", dataCorrupted="Data Corrupted", VKTchW="Touch weight", @@ -88,6 +88,7 @@ return{ noScore="No Score Yet", highScore="Highscore", newRecord="New Rocord", + invalidGame="Invalid Game", errorMsg="Techmino ran into a problem and needs to restart.\nWe collected some error info,and you can send them to author.", actName=actName, @@ -125,6 +126,8 @@ return{ "Techmino=Technique+Tetromino", "CLASSIC SEXY RUSSIAN BLOCKS", "Headphones for better experience", + "少女祈禱中", + "少女折壽中", "LrL,RlR LLr,RRl RRR/LLL F!!",--ZSLJTTI "(first effective)Your luck number today:"..math.random(100,626), }, @@ -175,12 +178,13 @@ Lib used: warning="DO NOT SHARE APP", WidgetText={ main={ - lang="言/A", play="Play", setting="Settings", music="Music room", stat="Statistics", help="Help", + qplay="qPlay", + lang="言/A", quit="Quit", }, mode={ diff --git a/list.lua b/list.lua index 643689cd..893e6f61 100644 --- a/list.lua +++ b/list.lua @@ -91,6 +91,7 @@ bgm={ "rockblock", "8-bit happiness", "shining terminal", + "chlorine", "end", } voiceBank={}--{{srcs1},{srcs2},...} diff --git a/main.lua b/main.lua index 774859cb..2b26034a 100644 --- a/main.lua +++ b/main.lua @@ -28,6 +28,8 @@ scr={x=0,y=0,w=0,h=0,rad=0,k=1}--x,y,wid,hei,radius,scale K local scr=scr mapCam={ sel=nil,--selected mode ID + lastPlay=1,--last played mode ID + x=0,y=0,k=1,--camera pos/k x1=0,y1=0,k1=1,--camera pos/k shown --basic paras @@ -71,6 +73,7 @@ require("default_data") require("class") require("ai") require("toolfunc") +require("file") require("sound") require("text") require("list") @@ -847,7 +850,7 @@ function love.mousereleased(x,y,k,t,num) if mouseUp[scene.cur]then mouseUp[scene.cur](mx,my,k) end - if(mx-lastX)^2+(my-lastY)^2<26 and mouseClick[scene.cur]then + if lastX and(mx-lastX)^2+(my-lastY)^2<26 and mouseClick[scene.cur]then mouseClick[scene.cur](mx,my,k) end end @@ -864,9 +867,10 @@ function love.touchpressed(id,x,y) love.touchmoved(id,x,y,0,0) end touchDist=nil--reset distance - lastX,lastY=xOy:inverseTransformPoint(x,y) + x,y=xOy:inverseTransformPoint(x,y) + lastX,lastY=x,y if touchDown[scene.cur]then - touchDown[scene.cur](id,lastX,lastY) + touchDown[scene.cur](id,x,y) end end function love.touchmoved(id,x,y,dx,dy) @@ -924,8 +928,8 @@ function love.keypressed(i) elseif i=="q"then local W=widget_sel if W then W:getInfo()end - elseif i=="e"then - error("Error Test") + elseif i=="f3"then + error("Techmino:挂了") elseif widget_sel then local W=widget_sel if i=="left"then W.x=W.x-10 @@ -1024,18 +1028,13 @@ function love.resize(w,h) scr.x,scr.y=(w-h*16/9)*.5,0 end xOy=xOy:setTransformation(w*.5,h*.5,nil,scr.k,nil,640,360) - if setting.bgspace then - space.resize(w,h) - space.new() - end + if setting.bgspace then space.new()end end function love.focus(f) if system~="Android" and not f and scene.cur=="play"then pauseGame()end end function love.update(dt) - if setting.bgspace then - space.update() - end + if setting.bgspace then space.update()end for i=#sysFX,1,-1 do local S=sysFX[i] S[2]=S[2]+1 @@ -1100,7 +1099,7 @@ function love.update(dt) Q.s=Q[2]and 2 or 4 elseif Q.s==2 then--播放1,准备2 if Q[1]:getDuration()-Q[1]:tell()<.08 then - Q[2]=getVoice(Q[2])--Bug:no voice called Q[2](may fixed) + Q[2]=getVoice(Q[2]) Q[2]:setVolume(setting.voc*.1) Q[2]:play() Q.s=3 @@ -1113,7 +1112,7 @@ function love.update(dt) Q.s=Q[2]and 2 or 4 end elseif Q.s==4 then--最后播放 - if not Q[1].isPlaying(Q[1])then--Bug:Q[1] is nil + if not Q[1].isPlaying(Q[1])then Q[1]=nil Q.s=0 end @@ -1146,7 +1145,7 @@ function love.errorhandler(msg) local CAP local function _(_)CAP=gc.newImage(_)end gc.captureScreenshot(_) - local T=0 + local T=true return function() PUMP() for e,a,b in POLL()do @@ -1157,26 +1156,21 @@ function love.errorhandler(msg) destroyPlayers() return"restart" elseif e=="resize"then - T=2 love.resize(a,b) end end - T=T+1 - if T==1 then + if T then if sfx.error then SFX("error",.8) end - elseif T==2 then + T=false + else + gc.discard() 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) @@ -1242,7 +1236,7 @@ function love.draw() gc.pop() gc.setColor(1,1,1) if powerInfoCanvas then - gc.draw(powerInfoCanvas) + gc.draw(powerInfoCanvas,0,0,0,scr.k) end--Power Info if scene.swapping then local _=scene.swap diff --git a/modes/GM.lua b/modes/GM.lua index 57bb5c38..a57cba28 100644 --- a/modes/GM.lua +++ b/modes/GM.lua @@ -45,7 +45,8 @@ return{ end, minarr=1, bg="game3",bgm="shining terminal", -}, + }, + slowMark=true, load=function() newPlayer(1,340,15) players[1].modeData.event="M7" diff --git a/modes/attacker_hard.lua b/modes/attacker_hard.lua index 18822323..83b5ee70 100644 --- a/modes/attacker_hard.lua +++ b/modes/attacker_hard.lua @@ -52,6 +52,7 @@ return{ end, bg="game3",bgm="push", }, + pauseLimit=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/attacker_ultimate.lua b/modes/attacker_ultimate.lua index 59b26b84..e24be144 100644 --- a/modes/attacker_ultimate.lua +++ b/modes/attacker_ultimate.lua @@ -60,7 +60,8 @@ return{ end end, bg="game4",bgm="shining terminal", -}, + }, + pauseLimit=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/bigbang.lua b/modes/bigbang.lua index d681cbb6..ec62b8bc 100644 --- a/modes/bigbang.lua +++ b/modes/bigbang.lua @@ -22,7 +22,7 @@ return{ "All-spin 入门教程", "All-spin Tutorial!", }, - color=color.grey, + color=color.lightGrey, env={ drop=1e99,lock=1e99, hold=false, @@ -30,13 +30,15 @@ return{ task=nil, bg="game1",bgm="newera", }, + pauseLimit=true, load=function() newPlayer(1,340,15) end, mesDisp=function(P,dx,dy) - setFont(60) - for i=1,5 do - mStr("UNFINISHED",120+10*i,100+50*i) + setFont(50) + for i=1,10 do + mStr("UNFINISHED",-126+35*i,60*i-110) + mStr("UNFINISHED",626-60*i,60*i-90) end end, score=function(P)return{P.modeData.event,P.stat.extraRate}end, diff --git a/modes/blind_easy.lua b/modes/blind_easy.lua index c8db1088..034f8789 100644 --- a/modes/blind_easy.lua +++ b/modes/blind_easy.lua @@ -24,6 +24,7 @@ return{ target=200, bg="glow",bgm="newera", }, + pauseLimit=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/blind_hard.lua b/modes/blind_hard.lua index 99efa582..62b3b81d 100644 --- a/modes/blind_hard.lua +++ b/modes/blind_hard.lua @@ -26,6 +26,7 @@ return{ target=200, bg="rgb",bgm="secret7th", }, + pauseLimit=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/blind_lunatic.lua b/modes/blind_lunatic.lua index c34f4d7b..c39a9282 100644 --- a/modes/blind_lunatic.lua +++ b/modes/blind_lunatic.lua @@ -26,6 +26,7 @@ return{ target=200, bg="rgb",bgm="secret8th", }, + pauseLimit=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/blind_normal.lua b/modes/blind_normal.lua index e5c829b4..dbedfc39 100644 --- a/modes/blind_normal.lua +++ b/modes/blind_normal.lua @@ -25,6 +25,7 @@ return{ target=200, bg="glow",bgm="reason", }, + pauseLimit=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/blind_ultimate.lua b/modes/blind_ultimate.lua index abee8ca2..bb14bde4 100644 --- a/modes/blind_ultimate.lua +++ b/modes/blind_ultimate.lua @@ -27,6 +27,7 @@ return{ target=200, bg="rgb",bgm="secret7th", }, + pauseLimit=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/c4wtrain_lunatic.lua b/modes/c4wtrain_lunatic.lua index bcd9b6fa..5a37ddaa 100644 --- a/modes/c4wtrain_lunatic.lua +++ b/modes/c4wtrain_lunatic.lua @@ -38,8 +38,9 @@ return{ drop=5,lock=30, dropPiece=check_c4w, freshLimit=15,ospin=false, - bg="rgb",bgm="newera", + bg="rgb",bgm="chlorine", }, + pauseLimit=true, load=function() newPlayer(1,340,15) local P=players[1] diff --git a/modes/c4wtrain_normal.lua b/modes/c4wtrain_normal.lua index 64c863c5..13a3d136 100644 --- a/modes/c4wtrain_normal.lua +++ b/modes/c4wtrain_normal.lua @@ -36,8 +36,9 @@ return{ drop=30,lock=60,oncehold=false, dropPiece=check_c4w, freshLimit=15,ospin=false, - bg="rgb",bgm="newera", + bg="rgb",bgm="chlorine", }, + pauseLimit=true, load=function() newPlayer(1,340,15) local P=players[1] diff --git a/modes/classic_fast.lua b/modes/classic_fast.lua index 2e5ca6e0..7f0f4540 100644 --- a/modes/classic_fast.lua +++ b/modes/classic_fast.lua @@ -40,7 +40,8 @@ return{ target=10,dropPiece=check_LVup, bg="rgb",bgm="rockblock", }, - slowmark=true, + pauseLimit=true, + slowMark=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/defender_lunatic.lua b/modes/defender_lunatic.lua index cac30f5b..22d84bec 100644 --- a/modes/defender_lunatic.lua +++ b/modes/defender_lunatic.lua @@ -53,6 +53,7 @@ return{ end, bg="game4",bgm="way", }, + pauseLimit=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/defender_normal.lua b/modes/defender_normal.lua index b7803e9c..658d1259 100644 --- a/modes/defender_normal.lua +++ b/modes/defender_normal.lua @@ -53,6 +53,7 @@ return{ end, bg="game3",bgm="way", }, + pauseLimit=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/dig_hard.lua b/modes/dig_hard.lua index f063d78b..f4cd84e7 100644 --- a/modes/dig_hard.lua +++ b/modes/dig_hard.lua @@ -31,6 +31,7 @@ return{ end, bg="game2",bgm="push", }, + pauseLimit=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/dig_ultimate.lua b/modes/dig_ultimate.lua index b705bbe7..cb2c64fe 100644 --- a/modes/dig_ultimate.lua +++ b/modes/dig_ultimate.lua @@ -29,7 +29,8 @@ return{ end end, bg="game2",bgm="secret7th", -}, + }, + pauseLimit=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/drought_lunatic.lua b/modes/drought_lunatic.lua index dd659c89..119888dc 100644 --- a/modes/drought_lunatic.lua +++ b/modes/drought_lunatic.lua @@ -24,6 +24,7 @@ return{ freshLimit=15, bg="glow",bgm="reason", }, + pauseLimit=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/drought_normal.lua b/modes/drought_normal.lua index fb389b80..ed529fad 100644 --- a/modes/drought_normal.lua +++ b/modes/drought_normal.lua @@ -24,6 +24,7 @@ return{ freshLimit=15, bg="glow",bgm="reason", }, + pauseLimit=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/marathon_hard.lua b/modes/marathon_hard.lua index f3636dda..a1d88b2d 100644 --- a/modes/marathon_hard.lua +++ b/modes/marathon_hard.lua @@ -37,7 +37,8 @@ return{ mindas=7,minarr=1,minsdarr=1, bg="strap",bgm="race", }, - slowmark=true, + pauseLimit=true, + slowMark=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/marathon_normal.lua b/modes/marathon_normal.lua index 7d395b1b..11e0816c 100644 --- a/modes/marathon_normal.lua +++ b/modes/marathon_normal.lua @@ -37,7 +37,8 @@ return{ minsdarr=1, bg="strap",bgm="way", }, - slowmark=true, + pauseLimit=true, + slowMark=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/master_adavnce.lua b/modes/master_adavnce.lua index c6d5bf5f..bb4ede7f 100644 --- a/modes/master_adavnce.lua +++ b/modes/master_adavnce.lua @@ -59,7 +59,7 @@ return{ freshLimit=15, bg="game2",bgm="secret7th", }, - slowmark=true, + slowMark=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/master_beginner.lua b/modes/master_beginner.lua index d333a703..a75c1b85 100644 --- a/modes/master_beginner.lua +++ b/modes/master_beginner.lua @@ -63,7 +63,7 @@ return{ freshLimit=15, bg="strap",bgm="secret8th", }, - slowmark=true, + slowMark=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/master_final.lua b/modes/master_final.lua index dc6fa6e5..185083b2 100644 --- a/modes/master_final.lua +++ b/modes/master_final.lua @@ -59,7 +59,7 @@ return{ easyFresh=false,bone=true, bg="none",bgm="shining terminal", }, - slowmark=true, + slowMark=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/pcchallenge_hard.lua b/modes/pcchallenge_hard.lua index 06017d60..4f8d5674 100644 --- a/modes/pcchallenge_hard.lua +++ b/modes/pcchallenge_hard.lua @@ -24,6 +24,7 @@ return{ ospin=false, bg="rgb",bgm="infinite", }, + pauseLimit=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/pcchallenge_lunatic.lua b/modes/pcchallenge_lunatic.lua index e375ea4b..4c06a415 100644 --- a/modes/pcchallenge_lunatic.lua +++ b/modes/pcchallenge_lunatic.lua @@ -24,6 +24,7 @@ return{ ospin=false, bg="rgb",bgm="infinite", }, + pauseLimit=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/pcchallenge_normal.lua b/modes/pcchallenge_normal.lua index 29dad317..8bd8d8de 100644 --- a/modes/pcchallenge_normal.lua +++ b/modes/pcchallenge_normal.lua @@ -23,6 +23,7 @@ return{ ospin=false, bg="rgb",bgm="newera", }, + pauseLimit=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/pctrain_lunatic.lua b/modes/pctrain_lunatic.lua index abea5e15..94ff11c6 100644 --- a/modes/pctrain_lunatic.lua +++ b/modes/pctrain_lunatic.lua @@ -88,8 +88,9 @@ return{ freshLimit=15, dropPiece=newPC, ospin=false, - bg="rgb",bgm="newera", + bg="rgb",bgm="chlorine", }, + pauseLimit=true, load=function() newPlayer(1,340,15) newPC(players[1]) diff --git a/modes/pctrain_normal.lua b/modes/pctrain_normal.lua index fc6e9e8e..e6583d86 100644 --- a/modes/pctrain_normal.lua +++ b/modes/pctrain_normal.lua @@ -71,8 +71,9 @@ return{ sequence="none", dropPiece=newPC, ospin=false, - bg="rgb",bgm="newera", + bg="rgb",bgm="chlorine", }, + pauseLimit=true, load=function() newPlayer(1,340,15) newPC(players[1]) diff --git a/modes/solo_1.lua b/modes/solo_1.lua index 7d126e18..da500fbe 100644 --- a/modes/solo_1.lua +++ b/modes/solo_1.lua @@ -20,6 +20,7 @@ return{ freshLimit=15, bg="game2",bgm="race", }, + pauseLimit=true, load=function() newPlayer(1,340,15) newPlayer(2,965,360,.5,AITemplate("9S",3)) diff --git a/modes/solo_2.lua b/modes/solo_2.lua index 9465a9e9..ae6c1936 100644 --- a/modes/solo_2.lua +++ b/modes/solo_2.lua @@ -20,6 +20,7 @@ return{ freshLimit=15, bg="game2",bgm="race", }, + pauseLimit=true, load=function() newPlayer(1,340,15) newPlayer(2,965,360,.5,AITemplate("9S",5)) diff --git a/modes/solo_3.lua b/modes/solo_3.lua index 75897fa7..5ce80564 100644 --- a/modes/solo_3.lua +++ b/modes/solo_3.lua @@ -20,6 +20,7 @@ return{ freshLimit=15, bg="game2",bgm="race", }, + pauseLimit=true, load=function() newPlayer(1,340,15) newPlayer(2,965,360,.5,AITemplate("9S",7)) diff --git a/modes/solo_4.lua b/modes/solo_4.lua index 79685b1c..f846c0b4 100644 --- a/modes/solo_4.lua +++ b/modes/solo_4.lua @@ -20,6 +20,7 @@ return{ freshLimit=15, bg="game2",bgm="race", }, + pauseLimit=true, load=function() newPlayer(1,340,15) newPlayer(2,965,360,.5,AITemplate("9S",8)) diff --git a/modes/solo_5.lua b/modes/solo_5.lua index c579f50b..97327d89 100644 --- a/modes/solo_5.lua +++ b/modes/solo_5.lua @@ -20,6 +20,7 @@ return{ freshLimit=15, bg="game2",bgm="race", }, + pauseLimit=true, load=function() newPlayer(1,340,15) newPlayer(2,965,360,.5,AITemplate("9S",9)) diff --git a/modes/sprint_10.lua b/modes/sprint_10.lua index 230e5288..9c927989 100644 --- a/modes/sprint_10.lua +++ b/modes/sprint_10.lua @@ -48,7 +48,7 @@ return{ T<=10 and 4 or T<=25 and 3 or T<=40 and 2 or - T<=60 and 1 or + T<=62 and 1 or 0 end, } \ No newline at end of file diff --git a/modes/sprint_20.lua b/modes/sprint_20.lua index b502285e..4400c518 100644 --- a/modes/sprint_20.lua +++ b/modes/sprint_20.lua @@ -47,8 +47,8 @@ return{ T<=13 and 5 or T<=18 and 4 or T<=45 and 3 or - T<=70 and 2 or - T<=100 and 1 or + T<=80 and 2 or + T<=126 and 1 or 0 end, } \ No newline at end of file diff --git a/modes/sprint_40.lua b/modes/sprint_40.lua index 503f0744..7cfbf28b 100644 --- a/modes/sprint_40.lua +++ b/modes/sprint_40.lua @@ -44,11 +44,11 @@ return{ if P.stat.row<40 then return end local T=P.stat.time return - T<=25 and 5 or - T<=32 and 4 or + T<=26 and 5 or + T<=32.6 and 4 or T<=40 and 3 or T<=62 and 2 or - T<=126 and 1 or + T<=183 and 1 or 0 end, } \ No newline at end of file diff --git a/modes/survivor_easy.lua b/modes/survivor_easy.lua index 7d9d7e35..cc9e11d7 100644 --- a/modes/survivor_easy.lua +++ b/modes/survivor_easy.lua @@ -33,6 +33,7 @@ return{ end, bg="glow",bgm="newera", }, + pauseLimit=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/survivor_hard.lua b/modes/survivor_hard.lua index 6bce5d38..a64001fa 100644 --- a/modes/survivor_hard.lua +++ b/modes/survivor_hard.lua @@ -38,6 +38,7 @@ return{ end, bg="glow",bgm="newera", }, + pauseLimit=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/survivor_lunatic.lua b/modes/survivor_lunatic.lua index 7788382b..e93eaf10 100644 --- a/modes/survivor_lunatic.lua +++ b/modes/survivor_lunatic.lua @@ -34,6 +34,7 @@ return{ end, bg="glow",bgm="newera", }, + pauseLimit=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/survivor_normal.lua b/modes/survivor_normal.lua index 0b06b93e..eebf1479 100644 --- a/modes/survivor_normal.lua +++ b/modes/survivor_normal.lua @@ -38,6 +38,7 @@ return{ end, bg="glow",bgm="newera", }, + pauseLimit=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/survivor_ultimate.lua b/modes/survivor_ultimate.lua index fafb4666..92a203bb 100644 --- a/modes/survivor_ultimate.lua +++ b/modes/survivor_ultimate.lua @@ -40,6 +40,7 @@ return{ end, bg="rgb",bgm="secret7th", }, + pauseLimit=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/techmino49_easy.lua b/modes/techmino49_easy.lua index b47e1364..d94c4cac 100644 --- a/modes/techmino49_easy.lua +++ b/modes/techmino49_easy.lua @@ -56,17 +56,17 @@ return{ local n=2 for i=1,4 do for j=1,6 do if L[n]then - newPlayer(n,78*i-54,115*j-98,.09,AITemplate("9S",rnd(4,6))) + newPlayer(n,78*i-54,115*j-98,.09,AITemplate("9S",rnd(2,5))) else - newPlayer(n,78*i-54,115*j-98,.09,AITemplate("CC",rnd(4,6)-1,2,true,10000)) + newPlayer(n,78*i-54,115*j-98,.09,AITemplate("CC",rnd(2,5)-1,2,true,10000)) end n=n+1 end end for i=9,12 do for j=1,6 do if L[n]then - newPlayer(n,78*i+267,115*j-98,.09,AITemplate("9S",rnd(4,6))) + newPlayer(n,78*i+267,115*j-98,.09,AITemplate("9S",rnd(2,5))) else - newPlayer(n,78*i+267,115*j-98,.09,AITemplate("CC",rnd(4,6)-1,2,true,10000)) + newPlayer(n,78*i+267,115*j-98,.09,AITemplate("CC",rnd(2,5)-1,2,true,10000)) end n=n+1 end end diff --git a/modes/techmino49_hard.lua b/modes/techmino49_hard.lua index a6a88ec2..15cb4b58 100644 --- a/modes/techmino49_hard.lua +++ b/modes/techmino49_hard.lua @@ -56,17 +56,17 @@ return{ local n=2 for i=1,4 do for j=1,6 do if L[n]then - newPlayer(n,78*i-54,115*j-98,.09,AITemplate("9S",rnd(4,8))) + newPlayer(n,78*i-54,115*j-98,.09,AITemplate("9S",rnd(4,7))) else - newPlayer(n,78*i-54,115*j-98,.09,AITemplate("CC",rnd(4,8)-1,3,true,20000)) + newPlayer(n,78*i-54,115*j-98,.09,AITemplate("CC",rnd(4,7)-1,3,true,20000)) end n=n+1 end end for i=9,12 do for j=1,6 do if L[n]then - newPlayer(n,78*i+267,115*j-98,.09,AITemplate("9S",rnd(4,8))) + newPlayer(n,78*i+267,115*j-98,.09,AITemplate("9S",rnd(4,7))) else - newPlayer(n,78*i+267,115*j-98,.09,AITemplate("CC",rnd(4,8)-1,3,true,20000)) + newPlayer(n,78*i+267,115*j-98,.09,AITemplate("CC",rnd(4,7)-1,3,true,20000)) end n=n+1 end end diff --git a/modes/techmino99_easy.lua b/modes/techmino99_easy.lua index 65283afe..c246360c 100644 --- a/modes/techmino99_easy.lua +++ b/modes/techmino99_easy.lua @@ -56,17 +56,17 @@ return{ local n=2 for i=1,7 do for j=1,7 do if L[n]then - newPlayer(n,46*i-36,97*j-72,.068,AITemplate("9S",rnd(4,8))) + newPlayer(n,46*i-36,97*j-72,.068,AITemplate("9S",rnd(2,5))) else - newPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(4,8)-1,2,true,10000)) + newPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(2,5)-1,2,true,10000)) end n=n+1 end end for i=15,21 do for j=1,7 do if L[n]then - newPlayer(n,46*i+264,97*j-72,.068,AITemplate("9S",rnd(4,8))) + newPlayer(n,46*i+264,97*j-72,.068,AITemplate("9S",rnd(2,5))) else - newPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(4,8)-1,2,true,10000)) + newPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(2,5)-1,2,true,10000)) end n=n+1 end end diff --git a/modes/techmino99_hard.lua b/modes/techmino99_hard.lua index 22177c8f..7fa1b997 100644 --- a/modes/techmino99_hard.lua +++ b/modes/techmino99_hard.lua @@ -56,17 +56,17 @@ return{ local n=2 for i=1,7 do for j=1,7 do 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,7))) else - newPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(4,6)-1,3,true,20000)) + newPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(4,7)-1,3,true,20000)) end n=n+1 end end for i=15,21 do for j=1,7 do 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,7))) else - newPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(4,6)-1,3,true,20000)) + newPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(4,7)-1,3,true,20000)) end n=n+1 end end diff --git a/modes/techmino99_ultimate.lua b/modes/techmino99_ultimate.lua index 8f69bb08..3ab6f560 100644 --- a/modes/techmino99_ultimate.lua +++ b/modes/techmino99_ultimate.lua @@ -56,17 +56,17 @@ return{ local n=2 for i=1,7 do for j=1,7 do 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(8,10))) else - newPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(4,6)-1,4,true,30000)) + newPlayer(n,46*i-36,97*j-72,.068,AITemplate("CC",rnd(8,10)-1,4,true,30000)) end n=n+1 end end for i=15,21 do for j=1,7 do 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(8,10))) else - newPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(4,6)-1,4,true,30000)) + newPlayer(n,46*i+264,97*j-72,.068,AITemplate("CC",rnd(8,10)-1,4,true,30000)) end n=n+1 end end diff --git a/modes/tsd_easy.lua b/modes/tsd_easy.lua index 5f3fbbb4..045fb928 100644 --- a/modes/tsd_easy.lua +++ b/modes/tsd_easy.lua @@ -32,6 +32,7 @@ return{ ospin=false, bg="matrix",bgm="reason", }, + pauseLimit=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/tsd_hard.lua b/modes/tsd_hard.lua index 214e215a..bb99103e 100644 --- a/modes/tsd_hard.lua +++ b/modes/tsd_hard.lua @@ -32,6 +32,7 @@ return{ ospin=false, bg="matrix",bgm="reason", }, + pauseLimit=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/tsd_ultimate.lua b/modes/tsd_ultimate.lua index a4e4decc..ae8695ac 100644 --- a/modes/tsd_ultimate.lua +++ b/modes/tsd_ultimate.lua @@ -32,6 +32,7 @@ return{ ospin=false, bg="matrix",bgm="reason", }, + pauseLimit=true, load=function() newPlayer(1,340,15) end, diff --git a/modes/ultra.lua b/modes/ultra.lua index 2384e4d7..432beaf5 100644 --- a/modes/ultra.lua +++ b/modes/ultra.lua @@ -25,6 +25,7 @@ return{ end, bg="matrix",bgm="infinite", }, + pauseLimit=true, load=function() newPlayer(1,340,15) end, diff --git a/paint.lua b/paint.lua index ff58f776..61f68378 100644 --- a/paint.lua +++ b/paint.lua @@ -79,9 +79,6 @@ local Pnt={BG={}} function Pnt.BG.none() gc.clear(.15,.15,.15) end -function Pnt.BG.black() - gc.clear() -end function Pnt.BG.grey() gc.clear(.3,.3,.3) end @@ -285,7 +282,7 @@ function Pnt.mode() setFont(30)mStr(M.level[lang],1100,50) gc.setColor(1,1,1) setFont(28)gc.printf(M.info[lang],920,110,360,"center") - if M.slowmark then + if M.slowMark then gc.draw(ctrlSpeedLimit,1230,50,nil,.4) end if M.score then @@ -471,10 +468,13 @@ function Pnt.pause() gc.origin() gc.rectangle("fill",0,0,scr.w,scr.h) gc.pop() - gc.setColor(1,1,1,pauseTimer*.02) setFont(25) + gc.setColor(1,1,1,pauseTimer*.02) if pauseCount>0 then + local _=curMode.pauseLimit and(pauseCount==1 and pauseTime>2.6 or pauseTime>6.26) + if _ then gc.setColor(1,.4,.4,pauseTimer*.02)end gc.print(text.pauseCount..":["..pauseCount.."] "..format("%0.2f",pauseTime).."s",110,150) + if _ then gc.setColor(1,1,1,pauseTimer*.02)end end for i=1,8 do gc.print(text.stat[i+3],110,30*i+270) diff --git a/parts/space.lua b/parts/space.lua index 89533479..78bb1eae 100644 --- a/parts/space.lua +++ b/parts/space.lua @@ -11,8 +11,8 @@ local function newPlanet() 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.vx=-cos(a+rnd()-.5)*.126 + planet.vy=-sin(a+rnd()-.5)*.126 planet.R=.7+rnd()*.2 planet.G=.7+rnd()*.1 end @@ -23,6 +23,7 @@ function space.resize(w,h) W,H=w+100,h+100 end function space.new() + if not W then space.resize(scr.w,scr.h)end newPlanet() for i=1,2600,5 do local s=0.75*2^(rnd()*1.5) @@ -97,7 +98,7 @@ function space.draw() 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) + gc.setColor(.9,.9,.9) for i=1,2600,5 do local x,y=stars[i+1],stars[i+2] gc.circle("fill",x,y,stars[i]) diff --git a/player.lua b/player.lua index 467a9238..df5124ce 100644 --- a/player.lua +++ b/player.lua @@ -1990,7 +1990,7 @@ function newDemoPlayer(id,x,y,size) block=true, visible="show", - Fkey=NULL,puzzle=false,ospin=true, + Fkey=nil,puzzle=false,ospin=true, freshLimit=1e99,easyFresh=true, target=1e99,dropPiece=NULL, } diff --git a/scene.lua b/scene.lua index 4c17c414..96766f3f 100644 --- a/scene.lua +++ b/scene.lua @@ -47,7 +47,7 @@ local sceneInit={ end end, mode=function() - curBG="black" + curBG="grey" BGM("blank") destroyPlayers() local cam=mapCam @@ -193,7 +193,6 @@ local backFunc={ pause=function() love.keyboard.setKeyRepeat(true) updateStat() - saveStat() clearTask("play") end, setting_game= function()saveSetting()end, diff --git a/timer.lua b/timer.lua index e30026cb..21d8e4b8 100644 --- a/timer.lua +++ b/timer.lua @@ -96,6 +96,25 @@ end function Tmr.main(dt) players[1]:update(dt) end +local function dumpTable(L) + local s="{\n" + for k,v in next,L do + local T + T=type(k) + if T=="number"then k="["..k.."]=" + elseif T=="string"then k=k.."=" + else error("Error data type!") + end + T=type(v) + if T=="number"then v=tostring(v) + elseif T=="string"then v="\""..v.."\"" + elseif T=="table"then v=dumpTable(v) + else error("Error data type!") + end + s=s..k..v..",\n" + end + return s.."}" +end function Tmr.mode(dt) local cam=mapCam local F @@ -106,10 +125,13 @@ function Tmr.mode(dt) 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 + local k=js1:getAxis(1) + if k~="c"then + if k=="u"or k=="ul"or k=="ur"then y=y-10*k;F=true end + if k=="d"or k=="dl"or k=="dl"then y=y+10*k;F=true end + if k=="l"or k=="ul"or k=="dl"then x=x-10*k;F=true end + if k=="r"or k=="ur"or k=="dr"then x=x+10*k;F=true end + end end if F or cam.keyCtrl and(x-cam.x1)^2+(y-cam.y1)^2>2.6 then if F then @@ -145,9 +167,11 @@ function Tmr.mode(dt) end cam.x,cam.y=x,y --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) + + if setting.bgspace then + 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) + end cam.x1=cam.x1*.85+x*.15 cam.y1=cam.y1*.85+y*.15 cam.k1=cam.k1*.85+k*.15 diff --git a/toolfunc.lua b/toolfunc.lua index 04d5ea56..6253befb 100644 --- a/toolfunc.lua +++ b/toolfunc.lua @@ -1,23 +1,10 @@ -local tm=love.timer -local gc=love.graphics -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 sub,find,format,char,byte=string.sub,string.find,string.format,string.char,string.byte +local tm,gc=love.timer,love.graphics +local kb,data=love.keyboard,love.data +local int,abs,rnd=math.floor,math.abs,math.random +local max,min=math.max,math.min +local sub,find=string.sub,string.find +local format,char,byte=string.format,string.char,string.byte local ins,rem=table.insert,table.remove -local toN,toS=tonumber,tostring -local concat=table.concat - -local function splitS(s,sep) - local t,n={},1 - repeat - local p=find(s,sep)or #s+1 - t[n]=sub(s,1,p-1) - n=n+1 - s=sub(s,p+#sep) - until #s==0 - return t -end function toTime(s) if s<60 then @@ -317,6 +304,7 @@ function resumeGame() end function loadGame(M) --rec={} + mapCam.lastPlay=M M=modes[M] curMode=M local lang=setting.lang @@ -400,269 +388,4 @@ function gameStart() P.timing=true P.control=true end -end -local fs=love.filesystem -function loadRecord(N) - local F=fs.newFile(N..".dat") - if F:open("r")then - local s=loadstring(F:read()) - local T={} - setfenv(s,T) - T[1]=s() - return T[1] - end -end -local function dumpTable(L) - local s="{\n" - for k,v in next,L do - local T - T=type(k) - if T=="number"then k="["..k.."]=" - elseif T=="string"then k=k.."=" - else error("Error data type!") - end - T=type(v) - if T=="number"then v=tostring(v) - elseif T=="string"then v="\""..v.."\"" - elseif T=="table"then v=dumpTable(v) - else error("Error data type!") - end - s=s..k..v..",\n" - end - print(s) - print("---") - return s.."}" -end -function saveRecord(N,L) - local F=fs.newFile(N..".dat") - F:open("w") - local _=F:write("return"..dumpTable(L)) - F:flush() - F:close() - if not _ then - TEXT(text.recSavingError..mes,640,480,40,"appear",.4) - end -end -function delRecord(N) - fs.remove(N..".dat") -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={ - "run","game","time", - "extraPiece","extraRate", - "key","rotate","hold","piece","row", - "atk","send","recv","pend", - "clear_1","clear_2","clear_3","clear_4", - "spin_0","spin_1","spin_2","spin_3", - "b2b","b3b","pc","score", -} -function loadStat() - local F=FILE.data - F:open("r") - local t=F:read() - F:close() - t=splitS(t,"\r\n") - for i=1,#t do - local p=find(t[i],"=") - if p then - local t,v=sub(t[i],1,p-1),sub(t[i],p+1) - 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 -function saveStat() - local t={} - for i=1,#statOpy do - t[i]=statOpy[i].."="..toS(stat[statOpy[i]]) - end - - local R={} - local RR=modeRanks - for i=1,#RR do - R[i]=RR[i]or"X" - end - t[#t+1]="rank="..concat(R,",") - --Save unlock infos - - t=concat(t,"\r\n") - local F=FILE.data - F:open("w") - local _=F:write(t) - F:flush() - F:close() - if not _ then - TEXT(text.statSavingError..mes,640,480,40,"appear",.4) - end -end - -function loadSetting() - local F=FILE.setting - F:open("r") - local t=F:read() - F:close() - t=splitS(t,"\r\n") - for i=1,#t do - local p=find(t[i],"=") - if p then - local t,v=sub(t[i],1,p-1),sub(t[i],p+1) - if--10档的设置 - --声音 - t=="sfx"or t=="bgm"or t=="voc"or t=="stereo"or - --三个触摸设置项 - t=="VKTchW"or t=="VKCurW"or t=="VKAlpha"or - --重开时间 - t=="reTime" - then - v=toN(v) - if v and v==int(v)and v>=0 and v<=10 then - setting[t]=v - end - elseif t=="vib"then - setting.vib=toN(v:match("[012345]"))or 0 - elseif t=="fullscreen"then - setting.fullscreen=v=="true" - love.window.setFullscreen(setting.fullscreen) - elseif - --开关设置们 - t=="bg"or - t=="ghost"or t=="center"or t=="grid"or t=="swap"or - t=="quickR"or t=="fine"or t=="bgspace"or t=="smo"or - t=="VKSwitch"or t=="VKTrack"or t=="VKDodge"or t=="VKIcon" - then - setting[t]=v=="true" - elseif t=="frameMul"then - setting.frameMul=min(max(toN(v)or 100,0),100) - elseif t=="das"or t=="arr"or t=="sddas"or t=="sdarr"then - v=toN(v)if not v or v<0 then v=0 end - setting[t]=int(v) - elseif t=="dropFX"or t=="shakeFX"or t=="atkFX"then - setting[t]=toN(v:match("[012345]"))or 0 - elseif t=="lang"then - setting[t]=toN(v:match("[123]"))or 1 - elseif t=="skin"then - setting[t]=toN(v:match("[12345678]"))or 1 - elseif t=="keymap"then - v=splitS(v,"/") - for i=1,16 do - local v1=splitS(v[i],",") - for j=1,#v1 do - setting.keyMap[i][j]=v1[j] - end - end - elseif t=="VK"then - v=splitS(v,"/") - local SK - for i=1,#v do - if v[i]then - SK=splitS(v[i],",") - local K=VK_org[i] - K.ava=SK[1]=="T" - K.x,K.y,K.r=toN(SK[2]),toN(SK[3]),toN(SK[4]) - end - end - end - end - end -end -local saveOpt={ - "das","arr", - "sddas","sdarr", - "reTime", - "quickR", - "swap", - "fine", - - "ghost","center", - "smo","grid", - "dropFX", - "shakeFX", - "atkFX", - "frameMul", - - "fullscreen", - "bg", - "bgspace", - "lang", - "skin", - - "sfx","bgm", - "vib","voc", - "stereo", - - "VKSwitch", - "VKTrack", - "VKDodge", - "VKTchW", - "VKCurW", - "VKIcon", - "VKAlpha", -} -function saveSetting() - local vk={}--virtualkey table - for i=1,#VK_org do - local V=VK_org[i] - vk[i]=concat({ - V.ava and"T"or"F", - int(V.x+.5), - int(V.y+.5), - V.r, - },",") - end--pre-pack virtualkey setting - local map={} - for i=1,16 do - map[i]=concat(setting.keyMap[i],",") - end - local t={ - "keymap="..toS(concat(map,"/")), - "VK="..toS(concat(vk,"/")), - } - for i=1,#saveOpt do - t[#t+1]=saveOpt[i].."="..toS(setting[saveOpt[i]]) - end - t=concat(t,"\r\n") - local F=FILE.setting - F:open("w") - local _,mes=F:write(t) - F:flush() - F:close() - if _ then - TEXT(text.settingSaved,370,330,30,"appear") - else - TEXT(text.settingSavingError.."123",370,350,20,"appear",.3) - end end \ No newline at end of file diff --git a/updateLog.lua b/updateLog.lua index f8c5ce2f..e071ef7e 100644 --- a/updateLog.lua +++ b/updateLog.lua @@ -27,9 +27,15 @@ Future outlook: CC smarter(think of garbage buffer) game recording new AI:task-Z - auto GUI position in any screen size more FXs & 3d features & animations Encrypt source code(compile to byte code) +0.8.9: + invalid game when pause too much + quick play re-added + space background little changed + bugs fixed +0.8.8+: + fixed many fatal bugs 0.8.8: background now is cool space with planets and stars,not boring falling tetrominos! records with date @@ -38,8 +44,12 @@ Future outlook: new error page and a new voice tiny change in rotate system(JL pistol-spin) marked the modes with limited das/arr + better board copy/paste + no black side in any screen size an unlock-all easter egg + cannot press invisible func key bugs fixed(some mode error) + add many fatal bugs 0.8.7: better user experience in mode selecting support 2^n G falling speed @@ -62,6 +72,7 @@ Future outlook: new mode:Big Bang button appearance changed better widget performence + remove Qplay many bug fixed 0.8.4: vocal more natural(important,may cause new bug) diff --git a/widgetList.lua b/widgetList.lua index d3c0852d..977372eb 100644 --- a/widgetList.lua +++ b/widgetList.lua @@ -139,13 +139,14 @@ local Widget={ 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"), 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,"quit"), - quit= newButton(590,460,200,160,C.lightGrey, 55,function()VOICE("bye")scene.swapTo("quit","slowFade")end,nil,"lang"), + stat= newButton(370,460,200,160,C.lightCyan, 43,function()scene.push()scene.swapTo("stat")end, nil,"qplay"), + qplay= newButton(590,460,200,160,C.lightOrange, 43,function()scene.push()loadGame(mapCam.lastPlay)end, nil,"lang"), lang= newButton(150,610,160,100,C.lightGreen, 45,function() setting.lang=setting.lang%#langName+1 changeLanguage(setting.lang) TEXT(text.lang,370,610,50,"appear",1.6) - end,nil,"play"), + end,nil,"quit"), + quit= newButton(590,610,160,100,C.lightGrey, 45,function()VOICE("bye")scene.swapTo("quit","slowFade")end,nil,"play"), }, 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),