Object disapear on touch.

How do I make my object disapear when I touch on it on Screen.
It needs to be removed. [import]uid: 134147 topic_id: 24210 reply_id: 324210[/import]

This should help. :slight_smile:

http://developer.anscamobile.com/code/quick-bubble-popper [import]uid: 21331 topic_id: 24210 reply_id: 97756[/import]

Thank you so much! :slight_smile: [import]uid: 134147 topic_id: 24210 reply_id: 97759[/import]

You wouldnt know how to make the game go," game over" if the object touches the ground? :o
[import]uid: 134147 topic_id: 24210 reply_id: 97763[/import]

OK. Check the link again. All you need is some good graphics, scoring, a little speed variance (well, the size of the bubble gives you a bit of that), and you could have a quick game!! Gotta love this stuff. Hope to see you as a subscriber soon and selling your wares!

http://developer.anscamobile.com/code/quick-bubble-popper
[import]uid: 21331 topic_id: 24210 reply_id: 97771[/import]

I tried this for my own game.

physics.start()

local ground = display.newImage( “ground.png” )
ground:setReferencePoint( display.BottomLeftReferencePoint )
ground.x, ground.y = 0, 530

physics.addBody( ground, “static”, { friction=1.0, density=1.0, bounce=0 } )

local obj = display.newImageRect( “obj.png”, 74, 104 )
obj.x, obj.y = 160, 300
physics.addBody( obj, { density=1.0, friction=0.3, bounce=0.3 } )

function obj:collision(event)

if(event.phase == “began”)then
if(event.other.name == “ground”)then
print(“Game Over”)
event.other:setFillColor(255,0,0)
EndGame()
end
end
end

but it will not work D:…
It’s supposed to be “Game Over” right?. Still don’t get any msg in the the simulator output.

Thank you for helping me. [import]uid: 134147 topic_id: 24210 reply_id: 97778[/import]

Look my code over. It has your answer, i promise. In the code you are providing, I do not see where you added the collision listener to your obj. [import]uid: 21331 topic_id: 24210 reply_id: 97781[/import]

My bad. thanks! [import]uid: 134147 topic_id: 24210 reply_id: 97782[/import]