How to detect collision with no physics ?

I’ve been wondering how to do collision detection on an object. Like an example from Bubble Ball were the ball would collide with the flag and would show an alert saying winner, or when it collides with the boost making the ball go fast. That what I mean about colliding with no physics which I think is call.

Can anyone help. Thanks :slight_smile: [import]uid: 17058 topic_id: 19110 reply_id: 319110[/import]

The example you give is different from your question. With physics you can set objects as sensors.

Code:

  
physics.addBody( enemy, { isSensor = true } )  
  

If you don’t want to use physics at all you need a runtime enterframe listener that tracks objects using pythagorean theorem. When objects overlap then trigger an event. [import]uid: 10903 topic_id: 19110 reply_id: 73647[/import]

In conjuction with the Runtime enterFrame listener crssmn mentioned, you could use the “contentBounds” properties of the two objects to see if they intersect. [import]uid: 94868 topic_id: 19110 reply_id: 73648[/import]

thanks for respond sorry if question was different to example [import]uid: 17058 topic_id: 19110 reply_id: 73651[/import]

This is a frequently asked question here in the forums. So I decided to write a blog post on it.

Please see:

http://omnigeek.robmiracle.com/2011/12/14/collision-detection-without-physics/

Let me know what you think!

Rob [import]uid: 19626 topic_id: 19110 reply_id: 73844[/import]

@crssm thanks for the help truly sorry for not appreciating your help. That actually help alot I thank you that alot. :slight_smile: [import]uid: 17058 topic_id: 19110 reply_id: 74598[/import]