0.190726α

This commit is contained in:
MrZ_26
2020-02-04 19:24:43 +08:00
parent f62613638e
commit 17094b988b
13 changed files with 611 additions and 463 deletions

233
paint.lua
View File

@@ -1,63 +1,116 @@
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
swap={
none={2,1,d=function()end},
flash={8,1,d=function()gc.clear(1,1,1)end},
deck={42,1,d=function()
local t=sceneSwaping.time
gc.setColor(1,1,1)
if t>6 then
for i=1,43-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]>0 then
gc.draw(blockSkin[bn],80*(cx+x-2),80*(10-cy-y),nil,8/3)
end
end end
end
else
gc.clear(1,1,1)
end
end
},
}--Scene swapping animations
function drawButton()
for i=1,#Buttons[scene]do
local B=Buttons[scene][i]
if not(B.hide and B.hide())then
local t=B==Buttons.sel and .3 or 0
B.alpha=abs(B.alpha-t)>.02 and(B.alpha+(B.alpha<t and .02 or -.02))or t
if B.alpha>t then B.alpha=B.alpha-.02 elseif B.alpha<t then B.alpha=B.alpha+.02 end
gc.setColor(B.rgb[1],B.rgb[2],B.rgb[3],B.alpha)
gc.rectangle("fill",B.x-B.w*.5,B.y-B.h*.5,B.w,B.h)
local t=B.t
if type(t)=="function"then t=t()
end
gc.setColor(B.rgb[1],B.rgb[2],B.rgb[3],.3)
gc.setLineWidth(5)gc.rectangle("line",B.x-B.w*.5,B.y-B.h*.5,B.w,B.h)
mStr(t,B.x-1,B.y-1-currentFont*.5)
mStr(t,B.x-1,B.y+1-currentFont*.5)
mStr(t,B.x+1,B.y-1-currentFont*.5)
mStr(t,B.x+1,B.y+1-currentFont*.5)
gc.setColor(B.rgb)
gc.setLineWidth(3)gc.rectangle("line",B.x-B.w*.5,B.y-B.h*.5,B.w,B.h)
mStr(t,B.x,B.y-currentFont*.5)
end
end
end
function drawDial(x,y,speed)
gc.push("transform")
gc.translate(x,y)
gc.setColor(1,1,1)
mStr(int(speed),0,-14)
gc.setColor(.6,.6,.6)gc.setLineWidth(5)
gc.circle("line",0,0,30)
gc.setColor(1,1,1)gc.setLineWidth(2)
gc.circle("line",0,0,30)
gc.rotate(2.0944+(speed<=175 and .020944*speed or 4.712389-52.35988/(speed-125)))
gc.setColor(.4,.4,.4,.5)gc.setLineWidth(5)
gc.line(0,0,22,0)
gc.setColor(.6,.6,.6,.5)gc.setLineWidth(3)
gc.line(0,0,22,0)
gc.pop()
end
function drawPixel(y,x,id,alpha)
gc.setColor(1,1,1,alpha)
gc.draw(blockSkin[id],30*x-30,600-30*y)
end
Pnt={BG={}}
function Pnt.BG.none()
gc.clear(.2,.2,.2)
end
function Pnt.BG.menu()
gc.setLineWidth(40)
gc.setColor(1,.9,.9)
local t=(Timer()%1)*100
for i=-6,9 do
gc.line(t+100*i,-50,t+100*i+600,650)
end
gc.setLineWidth(2)
gc.clear(.1,.1,.1)
end
function Pnt.BG.game1()
gc.setColor(1,1,1)
gc.draw(background[1],500,300,Timer()*.15,nil,nil,600,600)
gc.draw(background[1],640,360,Timer()*.15,nil,nil,768,768)
end
function Pnt.BG.game2()
gc.setColor(1,.5,.5)
gc.draw(background[1],500,300,Timer()*.15,nil,nil,600,600)
gc.draw(background[1],640,360,Timer()*.15,nil,nil,768,768)
end
function Pnt.BG.game3()
gc.setColor(.5,.7,1)
gc.draw(background[1],500,300,Timer()*.15,nil,nil,600,600)
end
function Pnt.BG.game4()
local t=215+sin(Timer()*6)*40
gc.setColor(255,t,t)
gc.rectangle("fill",0,0,1000,600)
end
function Pnt.BG.game5()
gc.setColor(1,.9,.9)
local t=(Timer()%1)*50
for x=0,20 do
for y=0,12 do
if(x+y)%2==0 then
gc.rectangle("fill",50*x-t,50*y-t,50,50)
end
end
end
gc.setColor(.6,.6,1)
gc.draw(background[1],640,360,Timer()*.15,nil,nil,768,768)
end
function Pnt.load()
if loadprogress then
gc.setLineWidth(3)
gc.setLineWidth(4)
gc.setColor(.8,.8,.8)
gc.rectangle("fill",200,280,loadprogress*600,40)
gc.rectangle("fill",340,340,loadprogress*640,40)
gc.setColor(1,1,1)
gc.rectangle("line",200,280,600,40)
gc.rectangle("line",340,340,640,40)
setFont(30)
mStr("Loading...",500,285)
mStr("Loading...",640,345)
end
end
function Pnt.intro()
gc.setColor(1,1,1)
gc.draw(img.title[setting.lang],500,300,nil,nil,nil,250,100)
end
function Pnt.main()
gc.setColor(1,1,1)
gc.draw(img.title[setting.lang],500,120,nil,nil,nil,250,60)
setFont(30)
gc.print("Alpha 0.0.19726",370,150)
gc.draw(img.title[setting.lang],30,30)
end
function Pnt.play()
for p=1,#players do
@@ -65,10 +118,10 @@ function Pnt.play()
setmetatable(_G,P.index)
gc.push("transform")
gc.translate(x,y)gc.scale(size)--Scale
gc.setColor(0,0,0,.8)gc.rectangle("fill",0,0,620,690)--Black Background
gc.setColor(0,0,0,.8)gc.rectangle("fill",0,0,600,690)--Black Background
gc.setLineWidth(3)
gc.setColor(1,1,1)gc.rectangle("line",0,0,620,690)--Big frame
gc.translate(160,70)
gc.setColor(1,1,1)gc.rectangle("line",0,0,600,690)--Big frame
gc.translate(150,70)
gc.stencil(stencil_field, "replace", 1)
gc.translate(0,fieldBeneath)
love.graphics.setStencilTest("equal",1)
@@ -81,39 +134,41 @@ function Pnt.play()
end
else
gc.setColor(1,1,1,falling/gameEnv.fall)
gc.rectangle("fill",0,600-30*j,300,30)
gc.rectangle("fill",0,600-30*j,320,30)
end
end--Field
if waiting<=0 then
if gameEnv.ghost then
for i=1,r do for j=1,c do
if cb[i][j]>0 then
drawPixel(i+y_img-1,j+cx-1,gameEnv.color[bn],.3)
drawPixel(i+y_img-1,j+cx-1,bn,.3)
end
end end
end--Ghost
gc.setColor(1,1,1,lockDelay/gameEnv.lock)
for i=1,r do for j=1,c do
if cb[i][j]>0 then
gc.rectangle("fill",30*(j+cx-1)-35,595-30*(i+cy-1),40,40)
gc.rectangle("fill",30*(j+cx-1)-34,596-30*(i+cy-1),38,38)
end
end end--BlockShade(lockdelay indicator)
for i=1,r do for j=1,c do
if cb[i][j]>0 then
drawPixel(i+cy-1,j+cx-1,gameEnv.color[bn],1)
drawPixel(i+cy-1,j+cx-1,bn,1)
end
end end--Block
if gameEnv.center then
local x=30*(cx+sc[2]-1)-30+15
gc.circle("fill",x,600-30*(cy+sc[1]-1)+15,4)
gc.setColor(1,1,1,.5)
gc.circle("fill",x,600-30*(y_img+sc[1]-1)+15,4)
end
end--Rotate center
end
gc.setColor(1,1,1)
gc.draw(PTC.dust[p])--Draw game field
love.graphics.setStencilTest()--In-field mask
love.graphics.setStencilTest()--In-playField mask
gc.translate(0,-fieldBeneath)
gc.setColor(1,1,1)gc.rectangle("line",-1,-1,300,600)--Draw boarder
local h=0
for i=1,#atkBuffer do
local a=atkBuffer[i]
@@ -128,11 +183,11 @@ function Pnt.play()
gc.rectangle("fill",302,600-h,8,-bar+5)
gc.setColor(1,1,0)
gc.rectangle("fill",302,600-h+(-bar+5),8,-(-bar+5)*(1-a.countdown/a.cd0))
--Time count
--Timing
else
gc.setColor(1,(sin((Timer()-i)*20)+1)*.5,0)
gc.rectangle("fill",302,600-h,8,-bar+5)
--warning
--Warning
end
else
gc.setColor(1,0,0)
@@ -151,7 +206,7 @@ function Pnt.play()
for i=1,#hb do
for j=1,#hb[1] do
if hb[i][j]>0 then
drawPixel(i+17.5-#hb*.5,j-2.5-#hb[1]*.5,holded and 13 or gameEnv.color[hn],1)
drawPixel(i+17.5-#hb*.5,j-2.5-#hb[1]*.5,holded and 13 or hn,1)
end
end
end
@@ -163,7 +218,7 @@ function Pnt.play()
for i=1,#b do
for j=1,#b[1] do
if b[i][j]>0 then
drawPixel(i+20-2.4*N-#b*.5,j+12.5-#b[1]*.5,gameEnv.color[nxt[N]],1)
drawPixel(i+20-2.4*N-#b*.5,j+12.5-#b[1]*.5,nxt[N],1)
end
end
end
@@ -180,22 +235,20 @@ function Pnt.play()
for i=1,#bonus do
bonus[i]:draw()
end--Effects
if mesDisp[gamemode]then mesDisp[gamemode]()end--Draw message
setFont(45)
gc.translate(380,550)
gc.setColor(1,1,1)
mStr(int(dropSpeed),0,-21)
gc.setColor(.6,.6,.6)gc.setLineWidth(5)
gc.circle("line",0,0,50)
gc.setColor(1,1,1)gc.setLineWidth(2)
gc.circle("line",0,0,50)
gc.rotate(2.0944+(dropSpeed<=175 and .020944*dropSpeed or 4.712389-52.35988/(dropSpeed-125)))
gc.setColor(.4,.4,.4,.5)gc.setLineWidth(5)
gc.line(0,0,40,0)
gc.setColor(.6,.6,.6,.5)gc.setLineWidth(3)
gc.line(0,0,40,0)
--Speed dial
gc.setColor(1,1,1)
setFont(40)
gc.print(format("%0.2f",time),-125,530)--Draw time
if mesDisp[gamemode]then mesDisp[gamemode]()end--Draw other message
setFont(15)
gc.setColor(1,1,1)
gc.print("BPM",380,490)
gc.print("KPM",335,580)
setFont(30)
drawDial(350,520,dropSpeed)
drawDial(400,570,keySpeed)
--Speed dials
gc.pop()
end--Draw players
gc.setLineWidth(3)
@@ -217,38 +270,40 @@ function Pnt.play()
end
setmetatable(_G,nil)
end
function Pnt.setting()
setFont(30)
gc.setColor(1,1,1)
mStr("DAS:"..setting.das,200,65)
mStr("ARR:"..setting.arr,400,65)
end
function Pnt.setting2()
setFont(30)
setFont(35)
gc.setColor(1,1,1)
mStr("DAS:"..setting.das,330,72)
mStr("ARR:"..setting.arr,545,72)
gc.setColor(1,1,1)
for i=1,9 do
gc.printf(actName_[i]..":",80,5+50*i,150,"right")
gc.printf(actName_show[i]..":",100,60*i-8,200,"right")
end
if keysetting then
setFont(35)
gc.print("<<",470,50*keysetting)
gc.print("<<",550,60*keysetting-10)
end
end
function Pnt.help()
setFont(32)
gc.setColor(1,1,1)
gc.draw(img.title[setting.lang],60,420,.2,.5+.05*sin(Timer()*2))
for i=1,11 do
mStr(Text.help[i],640,15+43*i)
end
gc.draw(img.title[setting.lang],180,600,.2,.7+.05*sin(Timer()*2),nil,140,100)
end
function Pnt.stat()
setFont(30)
gc.setColor(1,1,1)
gc.print(Text.stat[1],250,60)
gc.print(Text.stat[2],250,100)
gc.print(Text.stat[3],250,140)
gc.print(Text.stat[4],250,180)
gc.print(stat.game,600,60)
gc.print(format("%0.2f",stat.gametime).."s",600,100)
gc.print(stat.piece,600,140)
gc.print(stat.row,600,180)
gc.draw(img.title[setting.lang],60,420,.2,.5+.05*sin(Timer()*2))
for i=1,6 do
gc.print(Text.stat[i],250,20+40*i)
end
gc.print(stat.run,600,60)
gc.print(stat.game,600,100)
gc.print(format("%0.2f",stat.gametime).."s",600,140)
gc.print(stat.piece,600,180)
gc.print(stat.row,600,220)
gc.print(stat.atk,600,260)
gc.draw(img.title[setting.lang],180,600,.2,.7+.05*sin(Timer()*2),nil,140,100)
end