This has been driving me nuts for hours now, and I just cant figure it out.
I’m trying to modify the example code of Hot Cross Bunnies (the catapult code). I’ve added a few objects to the world, and want the “bullet” to collide with them.
http://developer.coronalabs.com/code/how-make-angry-birds-catapult The example code
What I added to it, just after the background image is loaded:
[code]-- Block
local block = display.newRect(_H / 2, _W / 2, 100, 100)
block:setFillColor(255,0,0)
physics.addBody( block, “dynamic”, { density=2, friction=0.3, bounce=0.2 } )
– Ground
local ground = display.newRect(350, 800, 300, 50)
ground:setFillColor(0,255,0)
physics.addBody( ground, “static”, { density=2, friction=0.3 } )[/code]
While those two collide just perfectly, the “bullet” just goes through them, ignoring them completely. What do I need to alter in order to have them collide? [import]uid: 200198 topic_id: 36150 reply_id: 336150[/import]