newplayer is genorated but physics are not set.
no errors.
1 2 3 4 5 6 7 | function onLocalCollision( self, event ) if event.other.id == "player" then newplayer = display.newCircle(500,500,100) physics.addBody(newplayer,{radius=100}) end end |
Give this a try.
1 2 3 4 5 6 7 8 9 10 11 | function onLocalCollision( self, event ) if event.other.id == "player" and not event.other.bodyType then timer.performWithDelay(1,function() newplayer = display.newCircle(500,500,100) physics.addBody(newplayer,{radius=100}) end,1) end end |
views:1247 update:2011/10/17 8:58:49