Skip to content

Commit

Permalink
气泡皮肤的连接状态会受连接高度规则变化了
Browse files Browse the repository at this point in the history
  • Loading branch information
MrZ626 committed May 4, 2024
1 parent 2cbc0e8 commit 6620dd2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion assets/game/puyoPlayer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1061,11 +1061,12 @@ function PP:render()
gc_translate(0,-40) -- Move to up-left corner of first cell

local width=SET.fieldW
local connH=self.settings.connH
for y=1,#matrix do
for x=1,width do
local C=matrix[y][x]
if C then
skin.drawFieldCell(C,matrix,x,y)
skin.drawFieldCell(C,matrix,x,y,connH)
end
gc_translate(40,0)
end
Expand Down
2 changes: 1 addition & 1 deletion assets/skin/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ local function _getTime() return SKIN.time end
---@field base string
---@field getTime function
---@field drawFieldBackground fun(fieldW:number)
---@field drawFieldCell fun(C:Techmino.Cell, F:Techmino.RectField, x:number, y:number)
---@field drawFieldCell fun(C:Techmino.Cell, F:Techmino.RectField, x:number, y:number, connH?:number)
---@field drawGhostCell fun(C:Techmino.Cell, B:Techmino.RectPiece, x:number, y:number)
---@field drawHandCellStroke fun(C:Techmino.Cell, B:Techmino.RectPiece, x:number, y:number)
---@field drawHandCell fun(C:Techmino.Cell, B:Techmino.RectPiece, x:number, y:number)
Expand Down
8 changes: 5 additions & 3 deletions assets/skin/puyo_jelly.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,22 @@ local gc_rectangle,gc_polygon=gc.rectangle,gc.polygon
local S={}
S.base='puyo_template'

local function drawSide(B,x,y)
local function drawSide(B,x,y,connH)
local c=B[y][x].color
local t
if connH and y>connH then return end
if B[y ] then t=B[y ][x+1] if t and t.connClear and t.color==c then gc_polygon('fill',40,8 ,40,32, 30,35, 30,5 ) end end
if B[y ] then t=B[y ][x-1] if t and t.connClear and t.color==c then gc_polygon('fill',0 ,8 ,0 ,32, 10,35, 10,5 ) end end
if B[y-1] then t=B[y-1][x ] if t and t.connClear and t.color==c then gc_polygon('fill',8 ,40, 32,40, 35,30 ,5 ,30) end end
if connH and y+1>connH then return end
if B[y+1] then t=B[y+1][x ] if t and t.connClear and t.color==c then gc_polygon('fill',8 ,0 , 32,0 , 35,10 ,5 ,10) end end
end

function S.drawFieldCell(C,F,x,y)
function S.drawFieldCell(C,F,x,y,connH)
if not C.clearing or S.getTime()%100<=50 then
gc_setColor(ColorTable[C.color])
gc_rectangle('fill',2,2,36,36,15)
drawSide(F,x,y)
drawSide(F,x,y,connH)
end
end

Expand Down
2 changes: 1 addition & 1 deletion assets/skin/puyo_template.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function S.drawFieldBackground(fieldW)
gc_rectangle('fill',0,0,40*fieldW,-80*fieldW)
end

function S.drawFieldCell(C,_,x,y)
function S.drawFieldCell(C,_,x,y,_)
if not C.clearing or S.getTime()%100<=50 then
gc_setColor(ColorTable[C.color])
gc_rectangle('fill',x,y,36,36,15)
Expand Down

0 comments on commit 6620dd2

Please sign in to comment.