As you can see, I'm new and starting right now with LÖVE.
So... I was reading the Getting Started and saw that love.update(dt) is called continuously to update everything.
Well, I was trying to do something and made this:
Code: Select all
function love.load()
love.window.setTitle("Jogo Legal")
char = love.graphics.newImage("avatar.png")
imgx = 400
imgy = 300
end
function love.update(dt)
function love.mousepressed(x, y, button, istouch)
if button == 1 then
imgx = x
imgy = y
end
end
end
function love.draw()
love.graphics.draw(char, imgx, imgy)
end
Well, what's the right place for it? I mean, I'm not calling this function everytime, so it should be inside love.update, since I use it to update the coordinates of my image, no? I don't get it hahaha
Ignore if it's a stupid question, I'm still learning
Cya,
Azvd