Changed drawing order and updated line connecting
This commit is contained in:
parent
abce928481
commit
178043bac3
2 changed files with 23 additions and 4 deletions
8
main.lua
8
main.lua
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue