Here's what I'm doing:animation.lua:129: attempt to call method 'getHeight' (a nill value)
Code: Select all
function love.load() anim = love.graphics.newImage("ballanim.png") ball.img = newAnimation(anim, 24, 24, 0.1, 6) end function love.update() ball.img:update(dt) end function love.draw() ball.img:draw(ball.x-ballWidth/2, ball.y-ballHeight/2) --obviously these values exist. I'm just showing you the parts dealing with the animation. end
I just don't see what I'm doing wrong.
EDIT: It seems AnAL goes apeshit over my use of ball.img. If I change it to something like testball = newAnimation(anim, 24, 24, 0.1, 6) and then change all references to ball.img to testball, it works.
However, after the last frame a single line is displayed. Why is that? My image is 3*24px wide and 2*24px high, and each frame is 24px.