I’m taking some (most) of the code from this :
http://mobile.tutsplus.com/tutorials/corona/corona-sdk_physics_explosions/
I can get everything to work except one section. For whatever reason, I cannot get luna to see this section (see below)
I added a print statement to see if it even shows up in the terminal and it doesn’t.
I’ve tried multiple configurations as well as placing the code in various locations but no matter what, it never get’s called.
I can get the bomb to show up and I can make the bomb explode but it always bypasses this function.
local function onLocalCollision( self, event )
print (“hello”)
if ( event.phase == “began” and self.myName == “circle” ) then
local forcex = event.other.x-self.x
local forcey = event.other.y-self.y
if(forcex < 0) then
forcex = 0-(80 + forcex)-12
else
forcex = 80 - forcex+12
end
event.other:applyForce( forcex, forcey, self.x, self.y )
if(math.abs(forcex) > 60 or math.abs(forcey) > 60) then
local explosion = display.newImage( “explosion.png”, event.other.x, event.other.y )
event.other:removeSelf()
local function removeExplosion( event )
explosion:removeSelf()
end
timer.performWithDelay( 50, removeExplosion)
end
end
end
[import]uid: 127842 topic_id: 22789 reply_id: 322789[/import]