Almost working from 1st try
This commit is contained in:
commit
c6547c1121
8 changed files with 297 additions and 0 deletions
19
mouse.lua
Normal file
19
mouse.lua
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue