Hi Everyone…
Thanks for all the help and all my last post, you have help me learned a lot.
I have a new app in composer. (starting to work with it)
I have 4 balls – red, yellow, blue, green
all of them are bouncing around in the screen.
I have 1 object, a white circle.
In a simple function I am trying to make a function that will detect when
the “yellow” ball collide with the white circle ONLY!
local function onLocalCollision( self, event ) if ( event.phase == "began" ) then print("start collision, yellow touched white") elseif ( event.phase == "ended" ) then print("end collision, yellow is not touching white") end end yellow.collision = onLocalCollision yellow:addEventListener( "collision", yellow )
I have both names, when I create the objects
yellow.name = “yellow”
white.name = “white”
the yellow is “dynamic” and the white is “static”
Right now, as soon as any ball touches the white
I am detecting the collision, because in terminal I see the print stuff
but I just want to separate the balls, and only when the yellow touches the white?
Would you please help me do this?
Thanks you