incorporate code

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]

Check how you have spelled the function in the place where you call it, including the capitalisation.
Make sure the function is declared in code before the place you call it.
[import]uid: 108660 topic_id: 22789 reply_id: 90970[/import]

where would you declare it at? In the example I see no declaration before calling it.

This is the only other reference to it:

local function setBomb ( event )
if(event.phase == “began”) then
local bomb = display.newImage( “bomb.png”, event.x,event.y )
physics.addBody( bomb, { density=0.2, friction=0.1, bounce=0.5 } )

local circle = “”
local explosion = “”
local function blast( event )
media.playEventSound( explosionSound )
circle = display.newCircle( bomb.x, bomb.y, 80 )
explosion = display.newImage( “explosion.png”, bomb.x, bomb.y )
bomb:removeSelf()
circle:setFillColor(0,0,0, 0)
physics.addBody( circle, “static”, {isSensor = true} )
circle.myName = “circle”
circle.collision = onLocalCollision
circle:addEventListener( “collision”, circle )
end

Any ideas about removing multiple objects based on thier color? [import]uid: 127842 topic_id: 22789 reply_id: 90972[/import]

Got it figured out. Thanks.

Still looking for a way to remove multiple objects based on color.
What I mean is, how can I tell the code that when two like images are next to each other that they need to be removed. [import]uid: 127842 topic_id: 22789 reply_id: 91038[/import]