Page 1 of 1

Help Quad Animations Please

Posted: Sun May 21, 2017 2:44 am
by MetalMelnic
In my program I'm trying to animate a png image by breaking it up into quads and shifting the quad viewpoint for every frame of animation. My problem is that on line 33 I'm receiving an error: "bad argument #2 to 'draw' (Quad expected, got nil), but earlier in the love.load function I defined that quad. This doesn't make any sense to me since I was following a tutorial series with similar programming (I only flipped the viewpoint from horizontal to vertical) and the program ran fine (version used was the same as me). If you could please take time out of your day to help me that would be wonderful.

Link to tutorial video used: https://www.youtube.com/watch?v=_NpDbNtJyDQ

Re: Help Quad Animations Please

Posted: Sun May 21, 2017 5:28 am
by zorg
The issue is that you're redefining the love.load callback, as in, you have two of them; the latter one overwrites the first, meaning neither img nor quad will be defined.

You probably wanted love.draw as your last function, i suspect it was a copy-paste error. :3

Re: Help Quad Animations Please

Posted: Sun May 21, 2017 2:49 pm
by MetalMelnic
Thanks! I should have checked more into my functions before posting but thanks again for the help. =)