Changed drawing order and updated line connecting

This commit is contained in:
Alexey 2025-05-22 17:15:32 +03:00
commit 178043bac3
2 changed files with 23 additions and 4 deletions

View file

@ -56,8 +56,14 @@ function love.update( dt )
if vectorLength( mouse.point, lastLinePoint ) == 1
and gameGrid:inBounds( mouse.point )
and gameGrid:matchesLine( mouse.point, true ) == nil
and not lastLinePoint:equals( mouse.lastLine.endpoint ) then
and not lastLinePoint:equals( mouse.lastLine.endpoint )
and not gameGrid:isOtherEndpoint( mouse.lastLine, mouse.point ) then
mouse.lastLine:push( mouse.point )
elseif mouse.lastLine:has( mouse.point )
and not mouse.point:equals( lastLinePoint ) then
while not mouse.lastLine.points[#mouse.lastLine.points]:equals( mouse.point ) do
mouse.lastLine:pop()
end
end
end