hello, im new to lua and love and i too am also using the anal library. I got the same problem as you too when i first started but i sort of fixed it after a few minutes of fiddling. Go in your image editing program and sort of center your sprite and border each frame with say 2 pixels of transparency, so when anal is iterating through the frames you wont see any artifacts.
Example, your spritesheet has 4 frames and each frame is say 50 pixels wide and 80 pixels tall. Instead of having the finished sprite sheet 200 pixels by 160 pixels, space each frame by 2 pixels of transparency -> 4(50+2) = finished sprite sheet width = 208. Go to the next power of 2 if you have to. Now in your code, instead of having the width of each frame set at 50 pixels, make it 52.
I also have a bit of flashing in my animation too if i do things with love.graphics.translate(). I don't know how to fix this though.
The angle seems to be okay- it's not really noticeable, but if you want to modify it you might need to make a new angle variable and with it, calculate its dx separately - you're basing the angles of both arms with the x of one. example:
Code: Select all
leftarmx = 64
rightarmx = 70 --idk made it up, lets say it is :)
xmouse = love.mouse.getX()
ymouse = love.mouse.getY()
dxleft = (leftarmx+2+4) - xmouse
dxright = (rightarmx+2+4)-xmouse
dy = 82+4 - ymouse
angleleft = math.atan2(dxleft,-dy)
angleright = math.atan2(dxright,-dy)
then draw it with the appropriate angles!