Currently I have some crates that are falling from the sky and are hitting the ground and stopping, which is correct. But when another crate falls exactly on top it is overlapping a bit and then easing back up to where it is supposed to.
The code is:
[lua]function newLetter()
letter = display.newImage(“crate.png”);
letter.x = (col * 61) + 30;
letter.y = -100;
physics.addBody( letter, { density=1, friction=0.4, bounce=0} );
col = col + 1;
if(col > 4) then
col = 0;
end
end
local dropLetter = timer.performWithDelay( 1000, newLetter, 100 );[/lua]
I had an event listener in there that converted the crate to static once it hit the ground/item below it
[lua]local function onCollision( event )
if ( event.phase == “began” ) then
event.object2:addEventListener(“touch”, onTapBox )
event.object2.bodyType = “static”;
end
end
Runtime:addEventListener( “collision”, onCollision )[/lua]
But when I then tap a crate to remove it the crates above aren’t moving down like they should.
Any ideas? [import]uid: 132533 topic_id: 22905 reply_id: 322905[/import]
[import]uid: 118379 topic_id: 22905 reply_id: 91471[/import]
[import]uid: 132533 topic_id: 22905 reply_id: 91475[/import]