Trying to have a go at collision detection. Certain this doesn't seem as easy as my previous tool. :S
Code: Select all
--Inside love.load()
world = bump.newWorld(50)
-- create two rectangles
A = {name="A"}
B = {name="B"}
-- insert both rectangles into bump
world:add(A, player.x, player.y, 100, 100) -- left, top, width, height
world:add(B, item.x, item.y, 100, 100)
--Inside love.update(dt)
-- see if A is colliding with anything
local collisions, len = world:check(B)