Re: Hi all! - Various questions on Love2d
Posted: Sun Sep 07, 2014 4:22 pm
So I came back to working on my game again. I have the standing animation in place. I also have the beginning of my old main menu system.
Trying to have a go at collision detection. Certain this doesn't seem as easy as my previous tool. :S
Am I using this bump lib wrong?
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)