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
Problem with Library
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Ranguna259
- Party member
- Posts: 911
- Joined: Tue Jun 18, 2013 10:58 pm
- Location: I'm right next to you
Re: Problem with Library
You're doing:
But the variables 'x' and 'y' aren't being defined so you are actually doing:
and 'test.points[1][nil]' and 'test.points[1][nil]' are nil.
Code: Select all
love.graphics.rectangle("fill", test.points[1][x], test.points[1][y], 50, 50 )
Code: Select all
love.graphics.rectangle("fill", test.points[1][nil], test.points[1][nil], 50, 50 )
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 9 guests