HardonCollider Error: attempt to call method 'addRectangle' (a nil value)
Posted: Tue Feb 16, 2016 6:55 pm
As i do not want to implement my own collision detection algorithm, i have found a HardonCollider library to do the heavy lifting for me.
I have followed the example code of the library but got an error even with a basic setup.
Running this code will throw the following error message:
I have been investigating the problem, but did not find any solutions nor anybody else who faced this error.
I have followed the example code of the library but got an error even with a basic setup.
Code: Select all
local hc = require "hardoncollider"
local hero
local collider
function on_collision(dt, shape_a, shape_b, mtv_x, mtv_y)
end
function love.load(arg)
collider = hc(100, on_collision)
hero = collider:addRectangle(30,30,16,16)
end
Code: Select all
PS C:\dev\love-0.10.0-win64> Error: main.lua:12: attempt to call method 'addRectangle' (a nil value)
stack traceback:
main.lua:12: in function 'load'
[string "boot.lua"]:437: in function <[string "boot.lua"]:433>
[C]: in function 'xpcall'