重构背景系统(每个背景使用独立文件),全局变量名整理

This commit is contained in:
MrZ626
2020-11-04 00:08:50 +08:00
parent c688fef3f6
commit a485a71dfc
149 changed files with 1087 additions and 1046 deletions

View File

@@ -1,8 +1,6 @@
local gc=love.graphics
local kb=love.keyboard
local setFont=setFont
local find,sub,byte=string.find,string.sub,string.byte
function sceneInit.calculator()
@@ -87,9 +85,9 @@ function keyDown.calculator(k)
SFX.play("clear")
elseif v==72943816 then
S.pass=true
for name,M in next,Modes do
if not modeRanks[name]then
modeRanks[name]=M.score and 0 or 6
for name,M in next,MODES do
if not RANKS[name]then
RANKS[name]=M.score and 0 or 6
end
end
FILE.saveUnlock()

View File

@@ -2,7 +2,6 @@ local gc,sys=love.graphics,love.system
local kb=love.keyboard
local Timer=love.timer.getTime
local setFont=setFont
local int=math.floor
local find,sub=string.find,string.sub
@@ -43,7 +42,7 @@ function keyDown.customGame(key)
str=str.."!"..copyBoard().."!"
if #MISSION>0 then str=str..copyMission()end
sys.setClipboardText(str.."!")
LOG.print(text.copySuccess,color.green)
LOG.print(text.copySuccess,COLOR.green)
elseif key=="v"and kb.isDown("lctrl","rctrl")or key=="cV"then
local str=sys.getClipboardText()
local p1,p2,p3,p4,p5--ptr*
@@ -71,10 +70,10 @@ function keyDown.customGame(key)
break
end
end
LOG.print(text.pasteSuccess,color.green)
LOG.print(text.pasteSuccess,COLOR.green)
return
end
LOG.print(text.dataCorrupted,color.red)
LOG.print(text.dataCorrupted,COLOR.red)
elseif key=="escape"then
SCN.back()
else
@@ -92,10 +91,11 @@ function Pnt.customGame()
gc.rectangle("line",-2,-2,304,604)
local F=FIELD[1]
local cross=puzzleMark[-1]
local texture=SKIN.curText
for y=1,20 do for x=1,10 do
local B=F[y][x]
if B>0 then
gc.draw(blockSkin[B],30*x-30,600-30*y)
gc.draw(texture[B],30*x-30,600-30*y)
elseif B==-1 then
gc.draw(cross,30*x-30,600-30*y)
end

View File

@@ -1,9 +1,6 @@
local gc,sys=love.graphics,love.system
local ms,kb=love.mouse,love.keyboard
local setFont=setFont
local mStr=mStr
local max,min,int=math.max,math.min,math.floor
local ins,rem=table.insert,table.remove
local sub=string.sub
@@ -118,15 +115,15 @@ function keyDown.custom_field(key)
end
elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then
sys.setClipboardText("Techmino Field:"..copyBoard(S.page))
LOG.print(text.copySuccess,color.green)
LOG.print(text.copySuccess,COLOR.green)
elseif key=="v"and kb.isDown("lctrl","rctrl")or key=="cV"then
local str=sys.getClipboardText()
local p=string.find(str,":")--ptr*
if p then str=sub(str,p+1)end
if pasteBoard(str,S.page)then
LOG.print(text.pasteSuccess,color.green)
LOG.print(text.pasteSuccess,COLOR.green)
else
LOG.print(text.dataCorrupted,color.red)
LOG.print(text.dataCorrupted,COLOR.red)
end
elseif key=="tab"or key=="sTab"then
if key=="sTab"or kb.isDown("lshift","rshift")then
@@ -177,10 +174,11 @@ function Pnt.custom_field()
gc.setLineWidth(2)
local cross=puzzleMark[-1]
local F=FIELD[S.page]
local texture=SKIN.curText
for y=1,20 do for x=1,10 do
local B=F[y][x]
if B>0 then
gc.draw(blockSkin[B],30*x-30,600-30*y)
gc.draw(texture[B],30*x-30,600-30*y)
elseif B==-1 and not S.demo then
gc.draw(cross,30*x-30,600-30*y)
end
@@ -237,23 +235,23 @@ WIDGET.init("custom_field",{
WIDGET.newText({name="title", x=1020,y=5,font=70,align="R"}),
WIDGET.newText({name="subTitle", x=1030,y=50,font=35,align="L",color="grey"}),
WIDGET.newButton({name="b1", x=580, y=130,w=75,color={color.rainbow( 1.471)},code=setPen(1)}),--B1
WIDGET.newButton({name="b2", x=660, y=130,w=75,color={color.rainbow( 1.078)},code=setPen(2)}),--B2
WIDGET.newButton({name="b3", x=740, y=130,w=75,color={color.rainbow( 0.685)},code=setPen(3)}),--B3
WIDGET.newButton({name="b4", x=820, y=130,w=75,color={color.rainbow( 0.293)},code=setPen(4)}),--B4
WIDGET.newButton({name="b5", x=900, y=130,w=75,color={color.rainbow(-0.100)},code=setPen(5)}),--B5
WIDGET.newButton({name="b6", x=980, y=130,w=75,color={color.rainbow(-0.493)},code=setPen(6)}),--B6
WIDGET.newButton({name="b7", x=1060, y=130,w=75,color={color.rainbow(-0.885)},code=setPen(7)}),--B7
WIDGET.newButton({name="b8", x=1140, y=130,w=75,color={color.rainbow(-1.278)},code=setPen(8)}),--B8
WIDGET.newButton({name="b1", x=580, y=130,w=75,color={COLOR.rainbow( 1.471)},code=setPen(1)}),--B1
WIDGET.newButton({name="b2", x=660, y=130,w=75,color={COLOR.rainbow( 1.078)},code=setPen(2)}),--B2
WIDGET.newButton({name="b3", x=740, y=130,w=75,color={COLOR.rainbow( 0.685)},code=setPen(3)}),--B3
WIDGET.newButton({name="b4", x=820, y=130,w=75,color={COLOR.rainbow( 0.293)},code=setPen(4)}),--B4
WIDGET.newButton({name="b5", x=900, y=130,w=75,color={COLOR.rainbow(-0.100)},code=setPen(5)}),--B5
WIDGET.newButton({name="b6", x=980, y=130,w=75,color={COLOR.rainbow(-0.493)},code=setPen(6)}),--B6
WIDGET.newButton({name="b7", x=1060, y=130,w=75,color={COLOR.rainbow(-0.885)},code=setPen(7)}),--B7
WIDGET.newButton({name="b8", x=1140, y=130,w=75,color={COLOR.rainbow(-1.278)},code=setPen(8)}),--B8
WIDGET.newButton({name="b9", x=580, y=210,w=75,color={color.rainbow(-1.671)},code=setPen(9)}),--B9
WIDGET.newButton({name="b10", x=660, y=210,w=75,color={color.rainbow(-2.063)},code=setPen(10)}),--B10
WIDGET.newButton({name="b11", x=740, y=210,w=75,color={color.rainbow(-2.456)},code=setPen(11)}),--B11
WIDGET.newButton({name="b12", x=820, y=210,w=75,color={color.rainbow(-2.849)},code=setPen(12)}),--B12
WIDGET.newButton({name="b13", x=900, y=210,w=75,color={color.rainbow(-3.242)},code=setPen(13)}),--B13
WIDGET.newButton({name="b14", x=980, y=210,w=75,color={color.rainbow(-3.634)},code=setPen(14)}),--B14
WIDGET.newButton({name="b15", x=1060, y=210,w=75,color={color.rainbow(-4.027)},code=setPen(15)}),--B15
WIDGET.newButton({name="b16", x=1140, y=210,w=75,color={color.rainbow(-4.412)},code=setPen(16)}),--B16
WIDGET.newButton({name="b9", x=580, y=210,w=75,color={COLOR.rainbow(-1.671)},code=setPen(9)}),--B9
WIDGET.newButton({name="b10", x=660, y=210,w=75,color={COLOR.rainbow(-2.063)},code=setPen(10)}),--B10
WIDGET.newButton({name="b11", x=740, y=210,w=75,color={COLOR.rainbow(-2.456)},code=setPen(11)}),--B11
WIDGET.newButton({name="b12", x=820, y=210,w=75,color={COLOR.rainbow(-2.849)},code=setPen(12)}),--B12
WIDGET.newButton({name="b13", x=900, y=210,w=75,color={COLOR.rainbow(-3.242)},code=setPen(13)}),--B13
WIDGET.newButton({name="b14", x=980, y=210,w=75,color={COLOR.rainbow(-3.634)},code=setPen(14)}),--B14
WIDGET.newButton({name="b15", x=1060, y=210,w=75,color={COLOR.rainbow(-4.027)},code=setPen(15)}),--B15
WIDGET.newButton({name="b16", x=1140, y=210,w=75,color={COLOR.rainbow(-4.412)},code=setPen(16)}),--B16
WIDGET.newButton({name="b17", x=580, y=290,w=75,color="dGrey", code=setPen(17)}),--BONE
WIDGET.newButton({name="b18", x=660, y=290,w=75,color="black", code=setPen(18)}),--HIDE

View File

@@ -2,7 +2,6 @@ local gc,sys=love.graphics,love.system
local kb=love.keyboard
local Timer=love.timer.getTime
local setFont=setFont
local int,sin=math.floor,math.sin
local ins,rem=table.insert,table.remove
local sub=string.sub
@@ -73,16 +72,16 @@ function keyDown.custom_mission(key)
elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then
if #MISSION>0 then
sys.setClipboardText("Techmino Target:"..copyMission())
LOG.print(text.copySuccess,color.green)
LOG.print(text.copySuccess,COLOR.green)
end
elseif key=="v"and kb.isDown("lctrl","rctrl")or key=="cV"then
local str=sys.getClipboardText()
local p=string.find(str,":")--ptr*
if p then str=sub(str,p+1)end
if pasteMission(str)then
LOG.print(text.pasteSuccess,color.green)
LOG.print(text.pasteSuccess,COLOR.green)
else
LOG.print(text.dataCorrupted,color.red)
LOG.print(text.dataCorrupted,COLOR.red)
end
elseif key=="escape"then
SCN.back()
@@ -161,9 +160,9 @@ function Pnt.custom_mission()
if N>0 then
gc.setColor(libColor[set[N]])
elseif L[i]>4 then
gc.setColor(color.rainbow(i+Timer()*6.26))
gc.setColor(COLOR.rainbow(i+Timer()*6.26))
else
gc.setColor(color.grey)
gc.setColor(COLOR.grey)
end
gc.print(missionEnum[L[i]],x,y-25)
x=x+56

View File

@@ -2,8 +2,6 @@ local gc,sys=love.graphics,love.system
local kb=love.keyboard
local Timer=love.timer.getTime
local setFont=setFont
local sin=math.sin
local ins,rem=table.insert,table.remove
local sub=string.sub
@@ -76,16 +74,16 @@ function keyDown.custom_sequence(key)
elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then
if #BAG>0 then
sys.setClipboardText("Techmino SEQ:"..copySequence())
LOG.print(text.copySuccess,color.green)
LOG.print(text.copySuccess,COLOR.green)
end
elseif key=="v"and kb.isDown("lctrl","rctrl")or key=="cV"then
local str=sys.getClipboardText()
local p=string.find(str,":")--ptr*
if p then str=sub(str,p+1)end
if pasteSequence(str)then
LOG.print(text.pasteSuccess,color.green)
LOG.print(text.pasteSuccess,COLOR.green)
else
LOG.print(text.dataCorrupted,color.red)
LOG.print(text.dataCorrupted,COLOR.red)
end
elseif key=="escape"then
SCN.back()

View File

@@ -1,7 +1,6 @@
local gc=love.graphics
local Timer=love.timer.getTime
local setFont=setFont
local int,abs=math.floor,math.abs
local min,sin=math.min,math.sin
local ins,rem=table.insert,table.remove
@@ -115,12 +114,12 @@ function Tmr.dict(dt)
end
local typeColor={
help=color.lGrey,
other=color.lOrange,
game=color.lCyan,
term=color.lRed,
english=color.green,
name=color.lPurple,
help=COLOR.lGrey,
other=COLOR.lOrange,
game=COLOR.lCyan,
term=COLOR.lRed,
english=COLOR.green,
name=COLOR.lPurple,
}
function Pnt.dict()
local S=sceneTemp
@@ -171,7 +170,7 @@ function Pnt.dict()
local r=Timer()*2
local R=int(r)%7+1
gc.setColor(1,1,1,1-abs(r%1*2-1))
gc.draw(TEXTURE.miniBlock[R],785,140,Timer()*10%6.2832,15,15,spinCenters[R][0][2]+.5,#blocks[R][0]-spinCenters[R][0][1]-.5)
gc.draw(TEXTURE.miniBlock[R],785,140,Timer()*10%6.2832,15,15,spinCenters[R][0][2]+.5,#BLOCKS[R][0]-spinCenters[R][0][1]-.5)
end
end

View File

@@ -1,8 +1,6 @@
local gc=love.graphics
local Timer=love.timer.getTime
local setFont=setFont
local mStr=mStr
local sin=math.sin
function sceneInit.help()

View File

@@ -1,5 +1,4 @@
local gc=love.graphics
local setFont=setFont
local max,min=math.max,math.min
local floatWheel=0

View File

@@ -23,11 +23,11 @@ function mouseDown.intro(_,_,k)
VOC.play("bye")
SCN.back()
elseif NOGAME=="delSetting"then
LOG.print("检测到过老版本非法设置数据,设置已经全部重置,请重启游戏完成",600,color.yellow)
LOG.print("Old version detected, setting file deleted, please restart the game",600,color.yellow)
LOG.print("检测到过老版本非法设置数据,设置已经全部重置,请重启游戏完成",600,COLOR.yellow)
LOG.print("Old version detected, setting file deleted, please restart the game",600,COLOR.yellow)
elseif NOGAME=="delCC"then
LOG.print("请关闭游戏,然后删除存档文件夹内的 CCloader.dll(21KB) !",600,color.yellow)
LOG.print("Please quit the game, then delete CCloader.dll(21KB) in saving folder!",600,color.yellow)
LOG.print("请关闭游戏,然后删除存档文件夹内的 CCloader.dll(21KB) !",600,COLOR.yellow)
LOG.print("Please quit the game, then delete CCloader.dll(21KB) in saving folder!",600,COLOR.yellow)
TASK.new(function(S)
S[1]=S[1]-1
if S[1]==0 then
@@ -39,7 +39,7 @@ function mouseDown.intro(_,_,k)
if newVersionLaunch then
SCN.push("main","fade")
SCN.swapTo("history","fade")
LOG.print(text.newVersion,"warn",color.lBlue)
LOG.print(text.newVersion,"warn",COLOR.lBlue)
else
SCN.go("main")
end

View File

@@ -2,7 +2,6 @@ local gc=love.graphics
local tc=love.touch
local Timer=love.timer.getTime
local setFont=setFont
local max,min,sin=math.max,math.min,math.sin
function sceneInit.load()
@@ -18,7 +17,7 @@ function sceneInit.load()
IMG.getCount(),
17,--Fontsize 20~100
SKIN.getCount(),
#Modes,
#MODES,
1,
1,
},
@@ -65,19 +64,19 @@ function Tmr.load()
elseif S.phase==6 then
SKIN.loadOne(S.cur)
elseif S.phase==7 then
local m=Modes[S.cur]--Mode template
local m=MODES[S.cur]--Mode template
local M=require("modes/"..m.name)--Mode file
Modes[m.name],Modes[S.cur]=M
MODES[m.name],MODES[S.cur]=M
for k,v in next,m do
M[k]=v
end
M.records=FILE.loadRecord(m.name)or M.score and{}
if M.score then
if modeRanks[M.name]==6 then
modeRanks[M.name]=0
if RANKS[M.name]==6 then
RANKS[M.name]=0
end
else
modeRanks[M.name]=6
RANKS[M.name]=6
end
-- M.icon=gc.newImage("image/modeIcon/"..m.icon..".png")
-- M.icon=gc.newImage("image/modeIcon/custom.png")
@@ -153,15 +152,15 @@ function Pnt.load()
gc.rectangle("fill",0,0,440,260)
local T=Timer()
gc.setColor(color.dCyan)
gc.setColor(COLOR.dCyan)
mDraw(S.text,220,Y*.2-1204)
mDraw(S.text,220,-Y*.2+1476)
gc.setColor(color.cyan)
gc.setColor(COLOR.cyan)
mDraw(S.text,220+4*sin(T*10),136+4*sin(T*6))
mDraw(S.text,220+4*sin(T*12),136+4*sin(T*8))
gc.setColor(color.dCyan)
gc.setColor(COLOR.dCyan)
mDraw(S.text,219,137)
mDraw(S.text,219,135)
mDraw(S.text,221,137)
@@ -177,7 +176,7 @@ function Pnt.load()
setFont(50)
for i=1,27 do
if i<26 then
local r,g,b=color.rainbow(i+3.5)
local r,g,b=COLOR.rainbow(i+3.5)
gc.setColor(r*.26,g*.26,b*.26)
gc.rectangle("fill",-220,Y-260*i-80,440,260)
gc.setColor(r*1.6,g*1.6,b*1.6)

View File

@@ -1,5 +1,4 @@
local gc=love.graphics
local setFont=setFont
function sceneInit.main()
sceneTemp={
@@ -37,7 +36,7 @@ end
WIDGET.init("main",{
WIDGET.newButton({name="play", x=150,y=220,w=200,h=140,color="lRed", font=55,code=WIDGET.lnk.goScene("mode")}),
WIDGET.newButton({name="setting", x=370,y=220,w=200,h=140,color="sky", font=45,code=WIDGET.lnk.goScene("setting_game")}),
WIDGET.newButton({name="custom", x=590,y=220,w=200,h=140,color="lPurple",font=45,code=WIDGET.lnk.goScene("customGame"),hide=function()return not modeRanks.marathon_normal end}),
WIDGET.newButton({name="custom", x=590,y=220,w=200,h=140,color="lPurple",font=45,code=WIDGET.lnk.goScene("customGame"),hide=function()return not RANKS.marathon_normal end}),
WIDGET.newButton({name="help", x=150,y=380,w=200,h=140,color="lYellow",font=50,code=WIDGET.lnk.goScene("help")}),
WIDGET.newButton({name="stat", x=370,y=380,w=200,h=140,color="lGreen", font=40,code=WIDGET.lnk.goScene("stat")}),
WIDGET.newButton({name="qplay", x=590,y=380,w=200,h=140,color="white", font=45,code=function()SCN.push()loadGame(STAT.lastPlay,true)end}),

View File

@@ -2,9 +2,6 @@ local gc=love.graphics
local ms,kb,tc=love.mouse,love.keyboard,love.touch
local Timer=love.timer.getTime
local setFont=setFont
local mStr=mStr
local int,abs=math.floor,math.abs
local sin=math.sin
@@ -30,7 +27,7 @@ function sceneInit.mode(org)
local cam=mapCam
cam.zoomK=org=="main"and 5 or 1
if cam.sel then
local M=Modes[cam.sel]
local M=MODES[cam.sel]
cam.x,cam.y=M.x*cam.k+180,M.y*cam.k
cam.x1,cam.y1=cam.x,cam.y
end
@@ -40,8 +37,8 @@ local function onMode(x,y)
local cam=mapCam
x=(cam.x1-640+x)/cam.k1
y=(cam.y1-360+y)/cam.k1
for name,M in next,Modes do
if modeRanks[name]then
for name,M in next,MODES do
if RANKS[name]then
local s=M.size
if M.shape==1 then
if x>M.x-s and x<M.x+s and y>M.y-s and y<M.y+s then return name end
@@ -85,7 +82,7 @@ function mouseClick.mode(x,y)
if _~=SEL then
if SEL then
cam.moving=true
_=Modes[SEL]
_=MODES[SEL]
cam.x=_.x*cam.k+180
cam.y=_.y*cam.k
cam.sel=SEL
@@ -165,8 +162,8 @@ function Tmr.mode()
cam.keyCtrl=true
end
local x1,y1=(cam.x1-180)/cam.k1,cam.y1/cam.k1
for name,M in next,Modes do
if modeRanks[name]then
for name,M in next,MODES do
if RANKS[name]then
local SEL
local s=M.size
if M.shape==1 then
@@ -200,7 +197,7 @@ function Tmr.mode()
cam.zoomMethod=_=="play"and 1 or _=="mode"and 2
if cam.zoomMethod==1 then
if cam.sel then
local M=Modes[cam.sel]
local M=MODES[cam.sel]
cam.x=cam.x*.8+M.x*cam.k*.2
cam.y=cam.y*.8+M.y*cam.k*.2
end
@@ -221,23 +218,23 @@ function Pnt.mode()
gc.scale(cam.zoomK)
gc.translate(-cam.x1,-cam.y1)
gc.scale(cam.k1)
local R=modeRanks
local R=RANKS
local sel=cam.sel
--Draw lines connecting modes
gc.setLineWidth(8)
gc.setColor(1,1,1,.2)
for name,M in next,Modes do
for name,M in next,MODES do
if R[name]and M.unlock then
for _=1,#M.unlock do
local m=Modes[M.unlock[_]]
local m=MODES[M.unlock[_]]
gc.line(M.x,M.y,m.x,m.y)
end
end
end
setFont(60)
for name,M in next,Modes do
for name,M in next,MODES do
if R[name]then
local S=M.size
local d=((M.x-(cam.x1+(sel and -180 or 0))/cam.k1)^2+(M.y-cam.y1/cam.k1)^2)^.55
@@ -295,7 +292,7 @@ function Pnt.mode()
end
gc.pop()
if sel then
local M=Modes[sel]
local M=MODES[sel]
gc.setColor(.7,.7,.7,.5)
gc.rectangle("fill",920,0,360,720)--Info board
gc.setColor(M.color)

View File

@@ -1,8 +1,6 @@
local gc=love.graphics
local Timer=love.timer.getTime
local setFont=setFont
local sin=math.sin
local floatWheel=0

View File

@@ -1,7 +1,6 @@
local gc=love.graphics
local Timer=love.timer.getTime
local setFont=setFont
local mStr=mStr
local int=math.floor
@@ -114,16 +113,16 @@ local function tapBoard(x,y,key)
if checkBoard(b)then
S.state=2
S.time=Timer()-S.startTime
if S.time<1 then LOG.print("不是人",color.lBlue)
elseif S.time<2 then LOG.print("还是人",color.lBlue)
elseif S.time<3 then LOG.print("神仙",color.lBlue)
elseif S.time<5 then LOG.print("太强了",color.lBlue)
elseif S.time<7.5 then LOG.print("很强",color.lBlue)
elseif S.time<10 then LOG.print("可以的",color.lBlue)
elseif S.time<20 then LOG.print("马上入门了",color.lBlue)
elseif S.time<30 then LOG.print("入门不远了",color.lBlue)
elseif S.time<60 then LOG.print("多加练习",color.lBlue)
else LOG.print("第一次玩?加油",color.lBlue)
if S.time<1 then LOG.print("不是人",COLOR.lBlue)
elseif S.time<2 then LOG.print("还是人",COLOR.lBlue)
elseif S.time<3 then LOG.print("神仙",COLOR.lBlue)
elseif S.time<5 then LOG.print("太强了",COLOR.lBlue)
elseif S.time<7.5 then LOG.print("很强",COLOR.lBlue)
elseif S.time<10 then LOG.print("可以的",COLOR.lBlue)
elseif S.time<20 then LOG.print("马上入门了",COLOR.lBlue)
elseif S.time<30 then LOG.print("入门不远了",COLOR.lBlue)
elseif S.time<60 then LOG.print("多加练习",COLOR.lBlue)
else LOG.print("第一次玩?加油",COLOR.lBlue)
end
SFX.play("win")
end
@@ -200,66 +199,66 @@ end
local frontColor={
[0]={
color.lRed,color.lRed,color.lRed,color.lRed,
color.lGreen,color.lBlue,color.lBlue,color.lBlue,
color.lGreen,color.lYellow,color.lPurple,color.lPurple,
color.lGreen,color.lYellow,color.lPurple,color.lPurple,
COLOR.lRed,COLOR.lRed,COLOR.lRed,COLOR.lRed,
COLOR.lGreen,COLOR.lBlue,COLOR.lBlue,COLOR.lBlue,
COLOR.lGreen,COLOR.lYellow,COLOR.lPurple,COLOR.lPurple,
COLOR.lGreen,COLOR.lYellow,COLOR.lPurple,COLOR.lPurple,
},--Colored(rank)
{
color.lRed,color.lRed,color.lRed,color.lRed,
color.lOrange,color.lYellow,color.lYellow,color.lYellow,
color.lOrange,color.lGreen,color.lBlue,color.lBlue,
color.lOrange,color.lGreen,color.lBlue,color.lBlue,
COLOR.lRed,COLOR.lRed,COLOR.lRed,COLOR.lRed,
COLOR.lOrange,COLOR.lYellow,COLOR.lYellow,COLOR.lYellow,
COLOR.lOrange,COLOR.lGreen,COLOR.lBlue,COLOR.lBlue,
COLOR.lOrange,COLOR.lGreen,COLOR.lBlue,COLOR.lBlue,
},--Rainbow(rank)
{
color.lRed,color.lRed,color.lRed,color.lRed,
color.lBlue,color.lBlue,color.lBlue,color.lBlue,
color.lGreen,color.lYellow,color.lPurple,color.lPurple,
color.lGreen,color.lYellow,color.lPurple,color.lPurple,
COLOR.lRed,COLOR.lRed,COLOR.lRed,COLOR.lRed,
COLOR.lBlue,COLOR.lBlue,COLOR.lBlue,COLOR.lBlue,
COLOR.lGreen,COLOR.lYellow,COLOR.lPurple,COLOR.lPurple,
COLOR.lGreen,COLOR.lYellow,COLOR.lPurple,COLOR.lPurple,
},--Colored(row)
{
color.white,color.white,color.white,color.white,
color.white,color.white,color.white,color.white,
color.white,color.white,color.white,color.white,
color.white,color.white,color.white,color.white,
COLOR.white,COLOR.white,COLOR.white,COLOR.white,
COLOR.white,COLOR.white,COLOR.white,COLOR.white,
COLOR.white,COLOR.white,COLOR.white,COLOR.white,
COLOR.white,COLOR.white,COLOR.white,COLOR.white,
},--Grey
{
color.white,color.white,color.white,color.white,
color.white,color.white,color.white,color.white,
color.white,color.white,color.white,color.white,
color.white,color.white,color.white,color.white,
COLOR.white,COLOR.white,COLOR.white,COLOR.white,
COLOR.white,COLOR.white,COLOR.white,COLOR.white,
COLOR.white,COLOR.white,COLOR.white,COLOR.white,
COLOR.white,COLOR.white,COLOR.white,COLOR.white,
},--Black
}
local backColor={
[0]={
color.dRed,color.dRed,color.dRed,color.dRed,
color.dGreen,color.dBlue,color.dBlue,color.dBlue,
color.dGreen,color.dYellow,color.dPurple,color.dPurple,
color.dGreen,color.dYellow,color.dPurple,color.dPurple,
COLOR.dRed,COLOR.dRed,COLOR.dRed,COLOR.dRed,
COLOR.dGreen,COLOR.dBlue,COLOR.dBlue,COLOR.dBlue,
COLOR.dGreen,COLOR.dYellow,COLOR.dPurple,COLOR.dPurple,
COLOR.dGreen,COLOR.dYellow,COLOR.dPurple,COLOR.dPurple,
},--Colored(rank)
{
color.dRed,color.dRed,color.dRed,color.dRed,
color.dOrange,color.dYellow,color.dYellow,color.dYellow,
color.dOrange,color.dGreen,color.dBlue,color.dBlue,
color.dOrange,color.dGreen,color.dBlue,color.dBlue,
COLOR.dRed,COLOR.dRed,COLOR.dRed,COLOR.dRed,
COLOR.dOrange,COLOR.dYellow,COLOR.dYellow,COLOR.dYellow,
COLOR.dOrange,COLOR.dGreen,COLOR.dBlue,COLOR.dBlue,
COLOR.dOrange,COLOR.dGreen,COLOR.dBlue,COLOR.dBlue,
},--Rainbow(rank)
{
color.dRed,color.dRed,color.dRed,color.dRed,
color.dBlue,color.dBlue,color.dBlue,color.dBlue,
color.dGreen,color.dYellow,color.dPurple,color.dPurple,
color.dGreen,color.dYellow,color.dPurple,color.dPurple,
COLOR.dRed,COLOR.dRed,COLOR.dRed,COLOR.dRed,
COLOR.dBlue,COLOR.dBlue,COLOR.dBlue,COLOR.dBlue,
COLOR.dGreen,COLOR.dYellow,COLOR.dPurple,COLOR.dPurple,
COLOR.dGreen,COLOR.dYellow,COLOR.dPurple,COLOR.dPurple,
},--Colored(row)
{
color.dGrey,color.dGrey,color.dGrey,color.dGrey,
color.dGrey,color.dGrey,color.dGrey,color.dGrey,
color.dGrey,color.dGrey,color.dGrey,color.dGrey,
color.dGrey,color.dGrey,color.dGrey,color.dGrey,
COLOR.dGrey,COLOR.dGrey,COLOR.dGrey,COLOR.dGrey,
COLOR.dGrey,COLOR.dGrey,COLOR.dGrey,COLOR.dGrey,
COLOR.dGrey,COLOR.dGrey,COLOR.dGrey,COLOR.dGrey,
COLOR.dGrey,COLOR.dGrey,COLOR.dGrey,COLOR.dGrey,
},--Grey
{
color.black,color.black,color.black,color.black,
color.black,color.black,color.black,color.black,
color.black,color.black,color.black,color.black,
color.black,color.black,color.black,color.black,
COLOR.black,COLOR.black,COLOR.black,COLOR.black,
COLOR.black,COLOR.black,COLOR.black,COLOR.black,
COLOR.black,COLOR.black,COLOR.black,COLOR.black,
COLOR.black,COLOR.black,COLOR.black,COLOR.black,
},--Black
}
function Pnt.p15()

View File

@@ -4,21 +4,20 @@ local Timer=love.timer.getTime
local setFont=setFont
local mStr=mStr
local sin=math.sin
local log=math.log
local sin,log=math.sin,math.log
local format=string.format
local SCR=SCR
local fnsRankColor={
Z=color.lYellow,
S=color.lGrey,
A=color.sky,
B=color.lGreen,
C=color.magenta,
D=color.dGreen,
E=color.red,
F=color.dRed,
Z=COLOR.lYellow,
S=COLOR.lGrey,
A=COLOR.sky,
B=COLOR.lGreen,
C=COLOR.magenta,
D=COLOR.dGreen,
E=COLOR.red,
F=COLOR.dRed,
}
function sceneInit.pause(org)
if
@@ -106,10 +105,10 @@ function sceneInit.pause(org)
S.fnsRankColor=fnsRankColor[S.rank]
if acc==1 then
S.trophy=text.finesse_ap
S.trophyColor=color.yellow
S.trophyColor=COLOR.yellow
elseif P.stat.maxFinesseCombo==P.stat.piece then
S.trophy=text.finesse_fc
S.trophyColor=color.lCyan
S.trophyColor=COLOR.lCyan
end
end
end

View File

@@ -2,9 +2,6 @@ local gc=love.graphics
local tc=love.touch
local Timer=love.timer.getTime
local setFont=setFont
local mStr=mStr
local max,sin=math.max,math.sin
local log=math.log

View File

@@ -1,9 +1,6 @@
local gc=love.graphics
local kb=love.keyboard
local setFont=setFont
local mStr=mStr
local abs=math.abs
local max,min=math.max,math.min
local rnd=math.random

View File

@@ -66,13 +66,13 @@ function Pnt.setting_control()
gc.line(550,530,550,630)
gc.line(950,530,950,630)
--Testing O mino
_=blockSkin[SETTING.skin[6]]
--O mino animation
local O=SKIN.curText[SETTING.skin[6]]
local x=550+40*sceneTemp.pos
gc.draw(_,x,540,nil,40/30)
gc.draw(_,x,580,nil,40/30)
gc.draw(_,x+40,540,nil,40/30)
gc.draw(_,x+40,580,nil,40/30)
gc.draw(O,x,540,nil,40/30)
gc.draw(O,x,580,nil,40/30)
gc.draw(O,x+40,540,nil,40/30)
gc.draw(O,x+40,580,nil,40/30)
end
local function sliderShow(S)

View File

@@ -12,7 +12,7 @@ end
function Pnt.setting_game()
gc.setColor(1,1,1)
gc.draw(blockSkin[int(Timer()*2)%16+1],590,540,Timer()%6.28319,2,nil,15,15)
gc.draw(SKIN.curText[int(Timer()*2)%16+1],590,540,Timer()%6.28319,2,nil,15,15)
end
WIDGET.init("setting_game",{

View File

@@ -1,7 +1,6 @@
local gc=love.graphics
local Timer=love.timer.getTime
local setFont=setFont
local mStr=mStr
local int,sin=math.floor,math.sin

View File

@@ -4,21 +4,22 @@ local sin=math.sin
function Pnt.setting_skin()
gc.setColor(1,1,1)
local texture=SKIN.curText
for N=1,7 do
local face=SETTING.face[N]
local B=blocks[N][face]
local B=BLOCKS[N][face]
local x,y=-55+140*N-spinCenters[N][face][2]*30,355+spinCenters[N][face][1]*30
local col=#B[1]
for i=1,#B do for j=1,col do
if B[i][j]then
gc.draw(blockSkin[SETTING.skin[N]],x+30*j,y-30*i)
gc.draw(texture[SETTING.skin[N]],x+30*j,y-30*i)
end
end end
gc.circle("fill",-10+140*N,340,sin(Timer()*10)+5)
end
gc.draw(blockSkin[17],930,610,nil,2)
gc.draw(texture[17],930,610,nil,2)
for i=1,5 do
gc.draw(blockSkin[19+i],570+60*i,610,nil,2)
gc.draw(texture[19+i],570+60*i,610,nil,2)
end
end

View File

@@ -1,9 +1,6 @@
local gc=love.graphics
local kb,tc=love.keyboard,love.touch
local setFont=setFont
local mStr=mStr
function sceneInit.staff()
sceneTemp={
time=0,

View File

@@ -1,7 +1,6 @@
local gc=love.graphics
local Timer=love.timer.getTime
local setFont=setFont
local mStr=mStr
local abs,int,sin=math.abs,math.floor,math.sin
@@ -89,8 +88,8 @@ function Pnt.stat()
local r=Timer()*2
local R=int(r)%7+1
gc.setColor(1,1,1,1-abs(r%1*2-1))
gc.draw(TEXTURE.miniBlock[R],650,50,Timer()*10%6.2832,15,15,spinCenters[R][0][2]+.5,#blocks[R][0]-spinCenters[R][0][1]-.5)
gc.draw(TEXTURE.miniBlock[R],650,300,0,15,15,spinCenters[R][0][2]+.5,#blocks[R][0]-spinCenters[R][0][1]-.5)
gc.draw(TEXTURE.miniBlock[R],650,50,Timer()*10%6.2832,15,15,spinCenters[R][0][2]+.5,#BLOCKS[R][0]-spinCenters[R][0][1]-.5)
gc.draw(TEXTURE.miniBlock[R],650,300,0,15,15,spinCenters[R][0][2]+.5,#BLOCKS[R][0]-spinCenters[R][0][1]-.5)
end
WIDGET.init("stat",{