This is a pretty simple fix, although there are several routes you can take.
My skype is zilarrezko_natvyr and I can answer some simple questions to the intermediate. However I'm pretty busy right now so I'll try and make this quick!
I made this actually earlier, but this is just a concept and kinda sucks, I would suggest finding a way to not use var and not use x2's and y2's and the like. but here's my code, pretty crappy. But one of the smarter guys will swing by and probably help you sooo much better.
Code: Select all
function love.load()
line = {
}
var1 = false
end
function love.draw()
if var1 then
love.graphics.setColor(255,255,255,255)
love.graphics.setLineWidth(10)
love.graphics.line(varx, vary, mousex, mousey)
end
for k, v in ipairs(line) do
love.graphics.setColor(255,255,255,255)
love.graphics.setLineWidth(10)
love.graphics.line(v.x, v.y, v.x2, v.y2)
end
end
function love.update(dt)
mousex, mousey = love.mouse.getPosition()
end
function love.mousepressed(x, y, b)
if b == "l" then
var1 = true
varx, vary = x, y
end
end
function love.mousereleased(x, y, b)
if b == "l" then
var1 = false
table.insert(line, {
x = varx,
y = vary,
x2 = x,
y2 = y
})
end
end
I'll be available in about two days, because the next couple of days I'm graduating and quite busy. Have fun with LÖVE!