I need some help I need to bind together several objects. For example I have 5 objects like this
local crate1 = display.newImage("crate.png")
-- crate1.x = math.random(0, 310)
crate1.x = 30
crate1.y = 45
-- crate1.rotation = math.random(0, 360)
physics.addBody(crate1, {density = 2.0, friction = 1.5, bounce=0.01})
crate1.myName = "crate"
local crate2 = display.newImage("crate.png")
-- crate1.x = math.random(0, 310)
crate2.x = 90
crate2.y = 45
-- crate1.rotation = math.random(0, 360)
physics.addBody(crate2, {density = 2.0, friction = 1.5, bounce=0.01})
crate2.myName = "crate"
local crate3 = display.newImage("crate.png")
-- crate1.x = math.random(0, 310)
crate3.x = 150
crate3.y = 45
-- crate1.rotation = math.random(0, 360)
physics.addBody(crate3, {density = 2.0, friction = 1.5, bounce=0.01})
crate3.myName = "crate"
local crate4 = display.newImage("crate.png")
-- crate1.x = math.random(0, 310)
crate4.x = 210
crate4.y = 45
-- crate1.rotation = math.random(0, 360)
physics.addBody(crate4, {density = 2.0, friction = 1.5, bounce=0.01})
crate4.myName = "crate"
local crate5 = display.newImage("crate.png")
-- crate1.x = math.random(0, 310)
crate5.x = 270
crate5.y = 45
-- crate1.rotation = math.random(0, 360)
physics.addBody(crate5, {density = 2.0, friction = 1.5, bounce=0.01})
crate5.myName = "crate"
I While the objects are falling downward from the top of the screen or wherever the objects are spawned from they must stay together. For example of another object is crate 3 for example the other crates (1, 2, 4, and 5) must stay together. Also I have a six object called crate6. When crate6 touches any of the crates, crates 1-5 need to be removed from the screen. Can some post a comment here and at e-mail timbojill@gmail.com or PM me through the website. [import]uid: 23642 topic_id: 36590 reply_id: 336590[/import]