Page 1 of 1

Problem with Library

Posted: Mon Oct 28, 2013 8:32 pm
by TheConfuZzledDude
I'm in the middle of making a collision library for my game, and even before i've put in the collision detection, it's started giving me an error when I try to draw my polygon, spitting out "main.lua:39: attempt to index a nil value". I find this strange because I had tested it before and it seemed to be working, and I've compared it to other libs like hump.vector, and I don't see what is going wrong!

https://dl.dropboxusercontent.com/u/300 ... ision.love

Re: Problem with Library

Posted: Mon Oct 28, 2013 8:39 pm
by Ranguna259
You're doing:

Code: Select all

love.graphics.rectangle("fill", test.points[1][x], test.points[1][y], 50, 50 )
But the variables 'x' and 'y' aren't being defined so you are actually doing:

Code: Select all

love.graphics.rectangle("fill", test.points[1][nil], test.points[1][nil], 50, 50 )
and 'test.points[1][nil]' and 'test.points[1][nil]' are nil.