My code is dropping a series of boxes on top of each other into a stack, and after the first couple boxes the stack compresses considerably with each new box. Is there a way to setup the physics so that the stack won’t compress?
Here is a snippet of code that shows what I’m talking about:
[code]
local physics = require(“physics”)
physics.start()
physics.setGravity(0, 15)
physics.setScale(90)
local floor = display.newRect(0, 420, 320, 20)
physics.addBody(floor, “static”, {bounce = 0})
local function drop(event)
block = display.newRoundedRect(120, 20, 46, 46, 7)
block:setFillColor(0, 0, 200)
local inset = 22
local shape = {-inset,-inset, inset,-inset, inset,inset, -inset,inset}
physics.addBody(block, {bounce = 0, shape = shape})
block.isFixedRotation = true
block.isBullet = true
end
timer.performWithDelay(2000, drop, 0)
[/code] [import]uid: 12108 topic_id: 4669 reply_id: 304669[/import]