De-nest Construct modes' display code

This commit is contained in:
NOT_A_ROBOT
2023-10-03 07:32:56 +07:00
parent a475232432
commit 2f6a3392e6
3 changed files with 87 additions and 96 deletions

View File

@@ -60,42 +60,39 @@ return {
GC.mStr(text.highest:repD(D.maxRankPts+1),63,336) GC.mStr(text.highest:repD(D.maxRankPts+1),63,336)
end end
if not D.showGuide then return end
ply_applyField(P) ply_applyField(P)
local mark=TEXTURE.puzzleMark local mark=TEXTURE.puzzleMark
if D.showGuide then local firstMistake=nil
local firstMistake=nil for y=1,D.rankPts+1 do
for y=1,D.rankPts+1 do for x=1,10 do
for x=1,10 do local texture=targetField[y][x]
local texture=targetField[y][x] -- Missing blocks
-- Missing blocks if not P:solid(x,y) and texture>0 then
if not P:solid(x,y) and texture>0 then -- Missing block under overhang
if P:solid(x,y+1) then
-- Missing block under overhang firstMistake=firstMistake or y
if P:solid(x,y+1) then gc_setColor(COLOR.R)
firstMistake=firstMistake or y else
gc_setColor(COLOR.R) gc_setColor(COLOR.Z)
else
gc_setColor(COLOR.Z)
end
gc_draw(mark[texture],30*x-30,600-30*y)
elseif texture<0 then
-- X always gets displayed, color changes based on whether there is a block there
if P:solid(x,y) then
gc_setColor(COLOR.R)
firstMistake=firstMistake or y
elseif D.rankPts>y then
gc_setColor(COLOR.G)
else
gc_setColor(COLOR.Z)
end
gc_draw(mark[texture],30*x-30,600-30*y)
end end
gc_draw(mark[texture],30*x-30,600-30*y)
elseif texture<0 then
-- X always gets displayed, color changes based on whether there is a block there
if P:solid(x,y) then
gc_setColor(COLOR.R)
firstMistake=firstMistake or y
elseif D.rankPts>y then
gc_setColor(COLOR.G)
else
gc_setColor(COLOR.Z)
end
gc_draw(mark[texture],30*x-30,600-30*y)
end end
if y==firstMistake then end
gc_setColor(1,0,0,.2*(math.sin(2*TIME())+1)) if y==firstMistake then
love.graphics.rectangle("fill",0,600-30*y,300,30) gc_setColor(1,0,0,.2*(math.sin(2*TIME())+1))
end love.graphics.rectangle("fill",0,600-30*y,300,30)
end end
end end
PLY.draw.cancelField() PLY.draw.cancelField()

View File

@@ -61,42 +61,39 @@ return {
GC.mStr(text.highest:repD(D.maxRankPts+1),63,336) GC.mStr(text.highest:repD(D.maxRankPts+1),63,336)
end end
if not D.showGuide then return end
ply_applyField(P) ply_applyField(P)
local mark=TEXTURE.puzzleMark local mark=TEXTURE.puzzleMark
if D.showGuide then local firstMistake=nil
local firstMistake=nil for y=1,D.rankPts+1 do
for y=1,D.rankPts+1 do for x=1,10 do
for x=1,10 do local texture=targetField[y][x]
local texture=targetField[y][x] -- Missing blocks
-- Missing blocks if not P:solid(x,y) and texture>0 then
if not P:solid(x,y) and texture>0 then -- Missing block under overhang
if P:solid(x,y+1) then
-- Missing block under overhang firstMistake=firstMistake or y
if P:solid(x,y+1) then gc_setColor(COLOR.R)
firstMistake=firstMistake or y else
gc_setColor(COLOR.R) gc_setColor(COLOR.Z)
else
gc_setColor(COLOR.Z)
end
gc_draw(mark[texture],30*x-30,600-30*y)
elseif texture<0 then
-- X always gets displayed, color changes based on whether there is a block there
if P:solid(x,y) then
gc_setColor(COLOR.R)
firstMistake=firstMistake or y
elseif D.rankPts>y then
gc_setColor(COLOR.G)
else
gc_setColor(COLOR.Z)
end
gc_draw(mark[texture],30*x-30,600-30*y)
end end
gc_draw(mark[texture],30*x-30,600-30*y)
elseif texture<0 then
-- X always gets displayed, color changes based on whether there is a block there
if P:solid(x,y) then
gc_setColor(COLOR.R)
firstMistake=firstMistake or y
elseif D.rankPts>y then
gc_setColor(COLOR.G)
else
gc_setColor(COLOR.Z)
end
gc_draw(mark[texture],30*x-30,600-30*y)
end end
if y==firstMistake then end
gc_setColor(1,0,0,.2*(math.sin(2*TIME())+1)) if y==firstMistake then
love.graphics.rectangle("fill",0,600-30*y,300,30) gc_setColor(1,0,0,.2*(math.sin(2*TIME())+1))
end love.graphics.rectangle("fill",0,600-30*y,300,30)
end end
end end
PLY.draw.cancelField() PLY.draw.cancelField()

View File

@@ -61,42 +61,39 @@ return {
GC.mStr(text.highest:repD(D.maxRankPts+1),63,336) GC.mStr(text.highest:repD(D.maxRankPts+1),63,336)
end end
if not D.showGuide then return end
ply_applyField(P) ply_applyField(P)
local mark=TEXTURE.puzzleMark local mark=TEXTURE.puzzleMark
if D.showGuide then local firstMistake=nil
local firstMistake=nil for y=1,D.rankPts+1 do
for y=1,D.rankPts+1 do for x=1,10 do
for x=1,10 do local texture=targetField[y][x]
local texture=targetField[y][x] -- Missing blocks
-- Missing blocks if not P:solid(x,y) and texture>0 then
if not P:solid(x,y) and texture>0 then -- Missing block under overhang
if P:solid(x,y+1) then
-- Missing block under overhang firstMistake=firstMistake or y
if P:solid(x,y+1) then gc_setColor(COLOR.R)
firstMistake=firstMistake or y else
gc_setColor(COLOR.R) gc_setColor(COLOR.Z)
else
gc_setColor(COLOR.Z)
end
gc_draw(mark[texture],30*x-30,600-30*y)
elseif texture<0 then
-- X always gets displayed, color changes based on whether there is a block there
if P:solid(x,y) then
gc_setColor(COLOR.R)
firstMistake=firstMistake or y
elseif D.rankPts>y then
gc_setColor(COLOR.G)
else
gc_setColor(COLOR.Z)
end
gc_draw(mark[texture],30*x-30,600-30*y)
end end
gc_draw(mark[texture],30*x-30,600-30*y)
elseif texture<0 then
-- X always gets displayed, color changes based on whether there is a block there
if P:solid(x,y) then
gc_setColor(COLOR.R)
firstMistake=firstMistake or y
elseif D.rankPts>y then
gc_setColor(COLOR.G)
else
gc_setColor(COLOR.Z)
end
gc_draw(mark[texture],30*x-30,600-30*y)
end end
if y==firstMistake then end
gc_setColor(1,0,0,.2*(math.sin(2*TIME())+1)) if y==firstMistake then
love.graphics.rectangle("fill",0,600-30*y,300,30) gc_setColor(1,0,0,.2*(math.sin(2*TIME())+1))
end love.graphics.rectangle("fill",0,600-30*y,300,30)
end end
end end
PLY.draw.cancelField() PLY.draw.cancelField()