Hello
I have two functions, both work in the same way, but one causes the simulator to crash.
I’m trying to using physics.addBody and this is what causes it to happen. Basically the code is designed to make an object called “bullet” disappear from the screen and reappear elsewhere when it hits a certain item on the screen. This code below is called using the event listener shown also below.
function transportBullet(event)
bullet:removeSelf();
bullet = display.newImage('bullet.png')
bullet:setReferencePoint(display.CenterReferencePoint);
bullet.x = 10
bullet.y = 10
physics.addBody(bullet, { density=2.0, friction=0, bounce=0.5, radius=9 } )
end
object3:addEventListener('collision',transportBullet)
I’m guessing there is an easier way to do this - any ideas why this happens or how to solve it?
Thanks! [import]uid: 45932 topic_id: 9201 reply_id: 309201[/import]
