Almost working from 1st try

This commit is contained in:
Alexey 2025-10-29 18:12:43 +03:00
commit c6547c1121
8 changed files with 297 additions and 0 deletions

19
mouse.lua Normal file
View file

@ -0,0 +1,19 @@
-- TODO: rewrite
---@class Mouse
---@field x integer
---@field y integer
---@field point GridPoint
Mouse = {
x = 0,
y = 0,
point = GridPoint:new( 0, 0 )
}
-- TODO: fix collision with other line's endpoint
function Mouse:update()
Mouse.x, Mouse.y = love.mouse.getPosition()
Mouse.x = Mouse.x + 1
Mouse.y = Mouse.y + 1
Mouse.point = GridPoint.snapCoords( Point:new( Mouse.x, Mouse.y ) )
end