我怎样才能打开和关闭" physics.addBody"在我的"酒吧"对象
如果我尝试:
physics.pause(bar, "static", {density=.1, bounce=.5, friction=.2,filter=barCosllisionFilter } )
所有物理暂停
bar object:
bar = display.newSprite( BARimageSheet, BARsequenceData1)
bar.x = display.contentWidth/2
bar.y = display.contentHeight/2
bar:play()
bar.collided = true
bar.name = "bar"
bar.gravityScale = 0.0
physics.addBody(bar, "static", {density=.0, bounce=.5, friction=.2,filter=barCosllisionFilter } )
bar.isVisible = true-- false
bar.isFixedRotation=true
screenGroup:insert(bar)
答案 0 :(得分:2)
尝试将其关闭:
--change the bar body's active state to false
bar.isBodyActive = false
要再次启用它,只需将属性设置为true即可。